repricing.proto 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.cloud.channel.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/timestamp.proto";
  19. import "google/type/date.proto";
  20. import "google/type/decimal.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "RepricingProto";
  24. option java_package = "com.google.cloud.channel.v1";
  25. // Specifies the different costs that the modified bill can be based on.
  26. enum RebillingBasis {
  27. // Not used.
  28. REBILLING_BASIS_UNSPECIFIED = 0;
  29. // Use the list cost, also known as the MSRP.
  30. COST_AT_LIST = 1;
  31. // Pass through all discounts except the Reseller Program Discount. If this is
  32. // the default cost base and no adjustments are specified, the output cost
  33. // will be exactly what the customer would see if they viewed the bill in the
  34. // Google Cloud Console.
  35. DIRECT_CUSTOMER_COST = 2;
  36. }
  37. // Configuration for how a reseller will reprice a Customer.
  38. message CustomerRepricingConfig {
  39. option (google.api.resource) = {
  40. type: "cloudchannel.googleapis.com/CustomerRepricingConfig"
  41. pattern: "accounts/{account}/customers/{customer}/customerRepricingConfigs/{customer_repricing_config}"
  42. };
  43. // Output only. Resource name of the CustomerRepricingConfig.
  44. // Format:
  45. // accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}.
  46. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  47. // Required. The configuration for bill modifications made by a reseller before
  48. // sending it to customers.
  49. RepricingConfig repricing_config = 2 [(google.api.field_behavior) = REQUIRED];
  50. // Output only. Timestamp of an update to the repricing rule. If `update_time` is after
  51. // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] then it indicates this was set
  52. // mid-month.
  53. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  54. }
  55. // Configuration for how a distributor will rebill a channel partner
  56. // (also known as a distributor-authorized reseller).
  57. message ChannelPartnerRepricingConfig {
  58. option (google.api.resource) = {
  59. type: "cloudchannel.googleapis.com/ChannelPartnerRepricingConfig"
  60. pattern: "accounts/{account}/channelPartnerLinks/{channel_partner}/channelPartnerRepricingConfigs/{channel_partner_repricing_config}"
  61. };
  62. // Output only. Resource name of the ChannelPartnerRepricingConfig.
  63. // Format:
  64. // accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}.
  65. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  66. // Required. The configuration for bill modifications made by a reseller before
  67. // sending it to ChannelPartner.
  68. RepricingConfig repricing_config = 2 [(google.api.field_behavior) = REQUIRED];
  69. // Output only. Timestamp of an update to the repricing rule. If `update_time` is after
  70. // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] then it indicates this was set
  71. // mid-month.
  72. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  73. }
  74. // Configuration for repricing a Google bill over a period of time.
  75. message RepricingConfig {
  76. // Applies the repricing configuration at the entitlement level.
  77. message EntitlementGranularity {
  78. // Resource name of the entitlement.
  79. // Format:
  80. // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
  81. string entitlement = 1 [(google.api.resource_reference) = {
  82. type: "cloudchannel.googleapis.com/Entitlement"
  83. }];
  84. }
  85. // Applies the repricing configuration at the channel partner level.
  86. // The channel partner value is derived from the resource name. Takes an
  87. // empty json object.
  88. message ChannelPartnerGranularity {
  89. }
  90. // Required. Defines the granularity for repricing.
  91. oneof granularity {
  92. // Applies the repricing configuration at the entitlement level. This is
  93. // the only supported value for CustomerRepricingConfig.
  94. EntitlementGranularity entitlement_granularity = 4;
  95. // Applies the repricing configuration at the channel partner level.
  96. // This is the only supported value for ChannelPartnerRepricingConfig.
  97. ChannelPartnerGranularity channel_partner_granularity = 5;
  98. }
  99. // Required. The YearMonth when these adjustments activate. The Day field needs to be
  100. // "0" since we only accept YearMonth repricing boundaries.
  101. google.type.Date effective_invoice_month = 1 [(google.api.field_behavior) = REQUIRED];
  102. // Required. Information about the adjustment.
  103. RepricingAdjustment adjustment = 2 [(google.api.field_behavior) = REQUIRED];
  104. // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to use for this bill. Specifies the relative cost
  105. // based on repricing costs you will apply.
  106. RebillingBasis rebilling_basis = 3 [(google.api.field_behavior) = REQUIRED];
  107. }
  108. // A type that represents the various adjustments you can apply to a bill.
  109. message RepricingAdjustment {
  110. // A oneof that represents the different types for this adjustment.
  111. oneof adjustment {
  112. // Flat markup or markdown on an entire bill.
  113. PercentageAdjustment percentage_adjustment = 2;
  114. }
  115. }
  116. // An adjustment that applies a flat markup or markdown to an entire bill.
  117. message PercentageAdjustment {
  118. // The percentage of the bill to adjust.
  119. // For example:
  120. // Mark down by 1% => "-1.00"
  121. // Mark up by 1% => "1.00"
  122. // Pass-Through => "0.00"
  123. google.type.Decimal percentage = 2;
  124. }