-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
offers.proto
332 lines (255 loc) · 9.05 KB
/
offers.proto
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
// Copyright 2024 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/cloud/channel/v1/common.proto";
import "google/cloud/channel/v1/products.proto";
import "google/protobuf/timestamp.proto";
import "google/type/money.proto";
option go_package = "cloud.google.com/go/channel/apiv1/channelpb;channelpb";
option java_multiple_files = true;
option java_outer_classname = "OffersProto";
option java_package = "com.google.cloud.channel.v1";
// Constraints type for Promotional offers.
enum PromotionalOrderType {
// Not used.
PROMOTIONAL_TYPE_UNSPECIFIED = 0;
// Order used for new customers, trial conversions and upgrades.
NEW_UPGRADE = 1;
// All orders for transferring an existing customer.
TRANSFER = 2;
// Orders for modifying an existing customer's promotion on the same SKU.
PROMOTION_SWITCH = 3;
}
// Describes how the reseller will be billed.
enum PaymentPlan {
// Not used.
PAYMENT_PLAN_UNSPECIFIED = 0;
// Commitment.
COMMITMENT = 1;
// No commitment.
FLEXIBLE = 2;
// Free.
FREE = 3;
// Trial.
TRIAL = 4;
// Price and ordering not available through API.
OFFLINE = 5;
}
// Specifies when the payment needs to happen.
enum PaymentType {
// Not used.
PAYMENT_TYPE_UNSPECIFIED = 0;
// Prepay. Amount has to be paid before service is rendered.
PREPAY = 1;
// Postpay. Reseller is charged at the end of the Payment cycle.
POSTPAY = 2;
}
// Represents the type for a monetizable resource(any entity on which billing
// happens). For example, this could be MINUTES for Google Voice and GB for
// Google Drive. One SKU can map to multiple monetizable resources.
enum ResourceType {
// Not used.
RESOURCE_TYPE_UNSPECIFIED = 0;
// Seat.
SEAT = 1;
// Monthly active user.
MAU = 2;
// GB (used for storage SKUs).
GB = 3;
// Active licensed users(for Voice SKUs).
LICENSED_USER = 4;
// Voice usage.
MINUTES = 5;
// For IaaS SKUs like Google Cloud, monetization is based on usage accrued on
// your billing account irrespective of the type of monetizable resource. This
// enum represents an aggregated resource/container for all usage SKUs on a
// billing account. Currently, only applicable to Google Cloud.
IAAS_USAGE = 6;
// For Google Cloud subscriptions like Anthos or SAP.
SUBSCRIPTION = 7;
}
// Period Type.
enum PeriodType {
// Not used.
PERIOD_TYPE_UNSPECIFIED = 0;
// Day.
DAY = 1;
// Month.
MONTH = 2;
// Year.
YEAR = 3;
}
// Represents an offer made to resellers for purchase.
// An offer is associated with a [Sku][google.cloud.channel.v1.Sku], has a plan
// for payment, a price, and defines the constraints for buying.
message Offer {
option (google.api.resource) = {
type: "cloudchannel.googleapis.com/Offer"
pattern: "accounts/{account}/offers/{offer}"
};
// Resource Name of the Offer.
// Format: accounts/{account_id}/offers/{offer_id}
string name = 1;
// Marketing information for the Offer.
MarketingInfo marketing_info = 2;
// SKU the offer is associated with.
Sku sku = 3;
// Describes the payment plan for the Offer.
Plan plan = 4;
// Constraints on transacting the Offer.
Constraints constraints = 5;
// Price for each monetizable resource type.
repeated PriceByResource price_by_resources = 6;
// Start of the Offer validity time.
google.protobuf.Timestamp start_time = 7;
// Output only. End of the Offer validity time.
google.protobuf.Timestamp end_time = 8
[(google.api.field_behavior) = OUTPUT_ONLY];
// Parameters required to use current Offer to purchase.
repeated ParameterDefinition parameter_definitions = 9;
// The deal code of the offer to get a special promotion or discount.
string deal_code = 12;
}
// Parameter's definition. Specifies what parameter is required to use the
// current Offer to purchase.
message ParameterDefinition {
// Data type of the parameter.
enum ParameterType {
// Not used.
PARAMETER_TYPE_UNSPECIFIED = 0;
// Int64 type.
INT64 = 1;
// String type.
STRING = 2;
// Double type.
DOUBLE = 3;
// Boolean type.
BOOLEAN = 4;
}
// Name of the parameter.
string name = 1;
// Data type of the parameter. Minimal value, Maximum value and allowed values
// will use specified data type here.
ParameterType parameter_type = 2;
// Minimal value of the parameter, if applicable. Inclusive. For example,
// minimal commitment when purchasing Anthos is 0.01.
// Applicable to INT64 and DOUBLE parameter types.
Value min_value = 3;
// Maximum value of the parameter, if applicable. Inclusive. For example,
// maximum seats when purchasing Google Workspace Business Standard.
// Applicable to INT64 and DOUBLE parameter types.
Value max_value = 4;
// If not empty, parameter values must be drawn from this list.
// For example, [us-west1, us-west2, ...]
// Applicable to STRING parameter type.
repeated Value allowed_values = 5;
// If set to true, parameter is optional to purchase this Offer.
bool optional = 6;
}
// Represents the constraints for buying the Offer.
message Constraints {
// Represents constraints required to purchase the Offer for a customer.
CustomerConstraints customer_constraints = 1;
}
// Represents constraints required to purchase the Offer for a customer.
message CustomerConstraints {
// Allowed geographical regions of the customer.
repeated string allowed_regions = 1;
// Allowed Customer Type.
repeated CloudIdentityInfo.CustomerType allowed_customer_types = 2;
// Allowed Promotional Order Type. Present for Promotional offers.
repeated PromotionalOrderType promotional_order_types = 3;
}
// The payment plan for the Offer. Describes how to make a payment.
message Plan {
// Describes how a reseller will be billed.
PaymentPlan payment_plan = 1;
// Specifies when the payment needs to happen.
PaymentType payment_type = 2;
// Describes how frequently the reseller will be billed, such as
// once per month.
Period payment_cycle = 3;
// Present for Offers with a trial period.
// For trial-only Offers, a paid service needs to start before the trial
// period ends for continued service.
// For Regular Offers with a trial period, the regular pricing goes into
// effect when trial period ends, or if paid service is started before the end
// of the trial period.
Period trial_period = 4;
// Reseller Billing account to charge after an offer transaction.
// Only present for Google Cloud offers.
string billing_account = 5;
}
// Represents price by resource type.
message PriceByResource {
// Resource Type. Example: SEAT
ResourceType resource_type = 1;
// Price of the Offer. Present if there are no price phases.
Price price = 2;
// Specifies the price by time range.
repeated PricePhase price_phases = 3;
}
// Represents the price of the Offer.
message Price {
// Base price.
google.type.Money base_price = 1;
// Discount percentage, represented as decimal.
// For example, a 20% discount will be represent as 0.2.
double discount = 2;
// Effective Price after applying the discounts.
google.type.Money effective_price = 3;
// Link to external price list, such as link to Google Voice rate card.
string external_price_uri = 4;
}
// Specifies the price by the duration of months.
// For example, a 20% discount for the first six months, then a 10% discount
// starting on the seventh month.
message PricePhase {
// Defines the phase period type.
PeriodType period_type = 1;
// Defines first period for the phase.
int32 first_period = 2;
// Defines first period for the phase.
int32 last_period = 3;
// Price of the phase. Present if there are no price tiers.
Price price = 4;
// Price by the resource tiers.
repeated PriceTier price_tiers = 5;
}
// Defines price at resource tier level.
// For example, an offer with following definition :
//
// * Tier 1: Provide 25% discount for all seats between 1 and 25.
// * Tier 2: Provide 10% discount for all seats between 26 and 100.
// * Tier 3: Provide flat 15% discount for all seats above 100.
//
// Each of these tiers is represented as a PriceTier.
message PriceTier {
// First resource for which the tier price applies.
int32 first_resource = 1;
// Last resource for which the tier price applies.
int32 last_resource = 2;
// Price of the tier.
Price price = 3;
}
// Represents period in days/months/years.
message Period {
// Total duration of Period Type defined.
int32 duration = 1;
// Period Type.
PeriodType period_type = 2;
}