// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.cloud.channel.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; import "google/type/date.proto"; import "google/type/decimal.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; option java_multiple_files = true; option java_outer_classname = "RepricingProto"; option java_package = "com.google.cloud.channel.v1"; // Specifies the different costs that the modified bill can be based on. enum RebillingBasis { // Not used. REBILLING_BASIS_UNSPECIFIED = 0; // Use the list cost, also known as the MSRP. COST_AT_LIST = 1; // Pass through all discounts except the Reseller Program Discount. If this is // the default cost base and no adjustments are specified, the output cost // will be exactly what the customer would see if they viewed the bill in the // Google Cloud Console. DIRECT_CUSTOMER_COST = 2; } // Configuration for how a reseller will reprice a Customer. message CustomerRepricingConfig { option (google.api.resource) = { type: "cloudchannel.googleapis.com/CustomerRepricingConfig" pattern: "accounts/{account}/customers/{customer}/customerRepricingConfigs/{customer_repricing_config}" }; // Output only. Resource name of the CustomerRepricingConfig. // Format: // accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. The configuration for bill modifications made by a reseller before // sending it to customers. RepricingConfig repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; // Output only. Timestamp of an update to the repricing rule. If `update_time` is after // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] then it indicates this was set // mid-month. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Configuration for how a distributor will rebill a channel partner // (also known as a distributor-authorized reseller). message ChannelPartnerRepricingConfig { option (google.api.resource) = { type: "cloudchannel.googleapis.com/ChannelPartnerRepricingConfig" pattern: "accounts/{account}/channelPartnerLinks/{channel_partner}/channelPartnerRepricingConfigs/{channel_partner_repricing_config}" }; // Output only. Resource name of the ChannelPartnerRepricingConfig. // Format: // accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. The configuration for bill modifications made by a reseller before // sending it to ChannelPartner. RepricingConfig repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; // Output only. Timestamp of an update to the repricing rule. If `update_time` is after // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] then it indicates this was set // mid-month. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Configuration for repricing a Google bill over a period of time. message RepricingConfig { // Applies the repricing configuration at the entitlement level. message EntitlementGranularity { // Resource name of the entitlement. // Format: // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} string entitlement = 1 [(google.api.resource_reference) = { type: "cloudchannel.googleapis.com/Entitlement" }]; } // Applies the repricing configuration at the channel partner level. // The channel partner value is derived from the resource name. Takes an // empty json object. message ChannelPartnerGranularity { } // Required. Defines the granularity for repricing. oneof granularity { // Applies the repricing configuration at the entitlement level. This is // the only supported value for CustomerRepricingConfig. EntitlementGranularity entitlement_granularity = 4; // Applies the repricing configuration at the channel partner level. // This is the only supported value for ChannelPartnerRepricingConfig. ChannelPartnerGranularity channel_partner_granularity = 5; } // Required. The YearMonth when these adjustments activate. The Day field needs to be // "0" since we only accept YearMonth repricing boundaries. google.type.Date effective_invoice_month = 1 [(google.api.field_behavior) = REQUIRED]; // Required. Information about the adjustment. RepricingAdjustment adjustment = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to use for this bill. Specifies the relative cost // based on repricing costs you will apply. RebillingBasis rebilling_basis = 3 [(google.api.field_behavior) = REQUIRED]; } // A type that represents the various adjustments you can apply to a bill. message RepricingAdjustment { // A oneof that represents the different types for this adjustment. oneof adjustment { // Flat markup or markdown on an entire bill. PercentageAdjustment percentage_adjustment = 2; } } // An adjustment that applies a flat markup or markdown to an entire bill. message PercentageAdjustment { // The percentage of the bill to adjust. // For example: // Mark down by 1% => "-1.00" // Mark up by 1% => "1.00" // Pass-Through => "0.00" google.type.Decimal percentage = 2; }