xref: /aosp_15_r20/external/googleapis/google/cloud/channel/v1/repricing.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.channel.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/timestamp.proto";
22import "google/type/date.proto";
23import "google/type/decimal.proto";
24
25option go_package = "cloud.google.com/go/channel/apiv1/channelpb;channelpb";
26option java_multiple_files = true;
27option java_outer_classname = "RepricingProto";
28option java_package = "com.google.cloud.channel.v1";
29
30// Specifies the different costs that the modified bill can be based on.
31enum RebillingBasis {
32  // Not used.
33  REBILLING_BASIS_UNSPECIFIED = 0;
34
35  // Use the list cost, also known as the MSRP.
36  COST_AT_LIST = 1;
37
38  // Pass through all discounts except the Reseller Program Discount. If this is
39  // the default cost base and no adjustments are specified, the output cost
40  // will be exactly what the customer would see if they viewed the bill in the
41  // Google Cloud Console.
42  DIRECT_CUSTOMER_COST = 2;
43}
44
45// Configuration for how a reseller will reprice a Customer.
46message CustomerRepricingConfig {
47  option (google.api.resource) = {
48    type: "cloudchannel.googleapis.com/CustomerRepricingConfig"
49    pattern: "accounts/{account}/customers/{customer}/customerRepricingConfigs/{customer_repricing_config}"
50  };
51
52  // Output only. Resource name of the CustomerRepricingConfig.
53  // Format:
54  // accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}.
55  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
56
57  // Required. The configuration for bill modifications made by a reseller
58  // before sending it to customers.
59  RepricingConfig repricing_config = 2 [(google.api.field_behavior) = REQUIRED];
60
61  // Output only. Timestamp of an update to the repricing rule. If `update_time`
62  // is after
63  // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]
64  // then it indicates this was set mid-month.
65  google.protobuf.Timestamp update_time = 3
66      [(google.api.field_behavior) = OUTPUT_ONLY];
67}
68
69// Configuration for how a distributor will rebill a channel partner
70// (also known as a distributor-authorized reseller).
71message ChannelPartnerRepricingConfig {
72  option (google.api.resource) = {
73    type: "cloudchannel.googleapis.com/ChannelPartnerRepricingConfig"
74    pattern: "accounts/{account}/channelPartnerLinks/{channel_partner}/channelPartnerRepricingConfigs/{channel_partner_repricing_config}"
75  };
76
77  // Output only. Resource name of the ChannelPartnerRepricingConfig.
78  // Format:
79  // accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}.
80  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
81
82  // Required. The configuration for bill modifications made by a reseller
83  // before sending it to ChannelPartner.
84  RepricingConfig repricing_config = 2 [(google.api.field_behavior) = REQUIRED];
85
86  // Output only. Timestamp of an update to the repricing rule. If `update_time`
87  // is after
88  // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]
89  // then it indicates this was set mid-month.
90  google.protobuf.Timestamp update_time = 3
91      [(google.api.field_behavior) = OUTPUT_ONLY];
92}
93
94// Configuration for repricing a Google bill over a period of time.
95message RepricingConfig {
96  // Applies the repricing configuration at the entitlement level.
97  message EntitlementGranularity {
98    // Resource name of the entitlement.
99    // Format:
100    // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
101    string entitlement = 1 [(google.api.resource_reference) = {
102      type: "cloudchannel.googleapis.com/Entitlement"
103    }];
104  }
105
106  // Applies the repricing configuration at the channel partner level.
107  // The channel partner value is derived from the resource name. Takes an
108  // empty json object.
109  // Deprecated: This is no longer supported. Use
110  // [RepricingConfig.EntitlementGranularity][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity]
111  // instead.
112  message ChannelPartnerGranularity {
113    option deprecated = true;
114  }
115
116  // Required. Defines the granularity for repricing.
117  oneof granularity {
118    // Applies the repricing configuration at the entitlement level.
119    //
120    // Note: If a
121    // [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig]
122    // using
123    // [RepricingConfig.EntitlementGranularity][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity]
124    // becomes effective, then no existing or future
125    // [RepricingConfig.ChannelPartnerGranularity][google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity]
126    // will apply to the
127    // [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement].
128    // This is the recommended value for both
129    // [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig]
130    // and
131    // [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig].
132    EntitlementGranularity entitlement_granularity = 4;
133
134    // Applies the repricing configuration at the channel partner level.
135    // Only
136    // [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig]
137    // supports this value. Deprecated: This is no longer supported. Use
138    // [RepricingConfig.entitlement_granularity][google.cloud.channel.v1.RepricingConfig.entitlement_granularity]
139    // instead.
140    ChannelPartnerGranularity channel_partner_granularity = 5
141        [deprecated = true];
142  }
143
144  // Required. The YearMonth when these adjustments activate. The Day field
145  // needs to be "0" since we only accept YearMonth repricing boundaries.
146  google.type.Date effective_invoice_month = 1
147      [(google.api.field_behavior) = REQUIRED];
148
149  // Required. Information about the adjustment.
150  RepricingAdjustment adjustment = 2 [(google.api.field_behavior) = REQUIRED];
151
152  // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to
153  // use for this bill. Specifies the relative cost based on repricing costs you
154  // will apply.
155  RebillingBasis rebilling_basis = 3 [(google.api.field_behavior) = REQUIRED];
156
157  // The conditional overrides to apply for this configuration. If you list
158  // multiple overrides, only the first valid override is used.  If you don't
159  // list any overrides, the API uses the normal adjustment and rebilling basis.
160  repeated ConditionalOverride conditional_overrides = 6;
161}
162
163// A type that represents the various adjustments you can apply to a bill.
164message RepricingAdjustment {
165  // A oneof that represents the different types for this adjustment.
166  oneof adjustment {
167    // Flat markup or markdown on an entire bill.
168    PercentageAdjustment percentage_adjustment = 2;
169  }
170}
171
172// An adjustment that applies a flat markup or markdown to an entire bill.
173message PercentageAdjustment {
174  // The percentage of the bill to adjust.
175  // For example:
176  // Mark down by 1% => "-1.00"
177  // Mark up by 1%   => "1.00"
178  // Pass-Through    => "0.00"
179  google.type.Decimal percentage = 2;
180}
181
182// Specifies the override to conditionally apply.
183message ConditionalOverride {
184  // Required. Information about the applied override's adjustment.
185  RepricingAdjustment adjustment = 1 [(google.api.field_behavior) = REQUIRED];
186
187  // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to
188  // use for the applied override. Shows the relative cost based on your
189  // repricing costs.
190  RebillingBasis rebilling_basis = 2 [(google.api.field_behavior) = REQUIRED];
191
192  // Required. Specifies the condition which, if met, will apply the override.
193  RepricingCondition repricing_condition = 3
194      [(google.api.field_behavior) = REQUIRED];
195}
196
197// Represents the various repricing conditions you can use for a conditional
198// override.
199message RepricingCondition {
200  // Represents the types of existing conditional statements.
201  oneof condition {
202    // SKU Group condition for override.
203    SkuGroupCondition sku_group_condition = 1;
204  }
205}
206
207// A condition that applies the override if a line item SKU is found in the SKU
208// group.
209message SkuGroupCondition {
210  // Specifies a SKU group (https://cloud.google.com/skus/sku-groups).
211  // Resource name of SKU group. Format:
212  // accounts/{account}/skuGroups/{sku_group}.
213  // Example:
214  // "accounts/C01234/skuGroups/3d50fd57-3157-4577-a5a9-a219b8490041".
215  string sku_group = 1;
216}
217