sentry_protos 0.50.2

Rust bindings for sentry-protos
Documentation
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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
// This file is @generated by prost-build.
/// Assigns a previously staged rollover balance to the new contract, completing
/// the rollover started by StageRolloverBalance. Balance changes are allowed after
/// a Balance is committed.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CommitRolloverBalanceRequest {
    #[prost(uint64, tag = "1")]
    pub previous_contract_id: u64,
    #[prost(uint64, tag = "2")]
    pub contract_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CommitRolloverBalanceResponse {}
/// How a Grant was created.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GrantSource {
    Unspecified = 0,
    /// Derived from a Trial row.
    TrialProduct = 1,
    TrialSubscription = 2,
    TrialPlan = 3,
    TrialEnterprise = 4,
    /// Promo-code redemption.
    Promo = 5,
    /// Recurring quota credit (e.g. monthly free errors).
    Recurring = 6,
    /// One-off admin/support gift.
    Gift = 7,
}
impl GrantSource {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "GRANT_SOURCE_UNSPECIFIED",
            Self::TrialProduct => "GRANT_SOURCE_TRIAL_PRODUCT",
            Self::TrialSubscription => "GRANT_SOURCE_TRIAL_SUBSCRIPTION",
            Self::TrialPlan => "GRANT_SOURCE_TRIAL_PLAN",
            Self::TrialEnterprise => "GRANT_SOURCE_TRIAL_ENTERPRISE",
            Self::Promo => "GRANT_SOURCE_PROMO",
            Self::Recurring => "GRANT_SOURCE_RECURRING",
            Self::Gift => "GRANT_SOURCE_GIFT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "GRANT_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
            "GRANT_SOURCE_TRIAL_PRODUCT" => Some(Self::TrialProduct),
            "GRANT_SOURCE_TRIAL_SUBSCRIPTION" => Some(Self::TrialSubscription),
            "GRANT_SOURCE_TRIAL_PLAN" => Some(Self::TrialPlan),
            "GRANT_SOURCE_TRIAL_ENTERPRISE" => Some(Self::TrialEnterprise),
            "GRANT_SOURCE_PROMO" => Some(Self::Promo),
            "GRANT_SOURCE_RECURRING" => Some(Self::Recurring),
            "GRANT_SOURCE_GIFT" => Some(Self::Gift),
            _ => None,
        }
    }
}
/// A non-billable quota allowance for an organization within a time window.
///
/// Grants can be offset by counter-grants: separate Grant rows with a negative
/// amount. The effective amount is the original amount plus the sum of all
/// counter-grant amounts, netted server-side and returned via
/// GetEffectiveGrants.
///
/// UNITS grants have exactly one entry in line_item_uids. CENTS grants may
/// have several.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Grant {
    #[prost(uint64, tag = "1")]
    pub id: u64,
    #[prost(uint64, tag = "2")]
    pub organization_id: u64,
    #[prost(enumeration = "GrantType", tag = "3")]
    pub r#type: i32,
    /// The line items this grant applies to.
    #[prost(string, repeated, tag = "4")]
    pub line_item_uids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The original amount. May be negative for counter-grants.
    #[prost(int64, tag = "5")]
    pub amount: i64,
    #[prost(message, optional, tag = "6")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "7")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
    #[prost(enumeration = "GrantStatus", tag = "8")]
    pub status: i32,
    #[prost(enumeration = "GrantSource", tag = "9")]
    pub source: i32,
}
/// Denomination of a Grant.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GrantType {
    Unspecified = 0,
    /// A quantity of units for specific line items.
    Units = 1,
    /// A monetary allowance measured in cents.
    Cents = 2,
}
impl GrantType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "GRANT_TYPE_UNSPECIFIED",
            Self::Units => "GRANT_TYPE_UNITS",
            Self::Cents => "GRANT_TYPE_CENTS",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "GRANT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "GRANT_TYPE_UNITS" => Some(Self::Units),
            "GRANT_TYPE_CENTS" => Some(Self::Cents),
            _ => None,
        }
    }
}
/// Lifecycle state of a Grant.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GrantStatus {
    Unspecified = 0,
    /// Consumable now; within \[start_date, end_date\].
    Active = 1,
    /// Manually deactivated (admin revoke, customer opt-out, etc.).
    Inactive = 2,
    /// Past end_date.
    Expired = 3,
}
impl GrantStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "GRANT_STATUS_UNSPECIFIED",
            Self::Active => "GRANT_STATUS_ACTIVE",
            Self::Inactive => "GRANT_STATUS_INACTIVE",
            Self::Expired => "GRANT_STATUS_EXPIRED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "GRANT_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "GRANT_STATUS_ACTIVE" => Some(Self::Active),
            "GRANT_STATUS_INACTIVE" => Some(Self::Inactive),
            "GRANT_STATUS_EXPIRED" => Some(Self::Expired),
            _ => None,
        }
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateGrantRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    /// Must be included when GrantType is UNITS
    #[prost(string, optional, tag = "2")]
    pub line_item_uid: ::core::option::Option<::prost::alloc::string::String>,
    /// Active period, inclusive on both ends.
    #[prost(message, optional, tag = "3")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "4")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
    #[prost(enumeration = "GrantType", tag = "5")]
    pub r#type: i32,
    #[prost(enumeration = "GrantSource", tag = "6")]
    pub source: i32,
    /// Interpretation depends on type. CENTS: amount in cents. UNITS: quantity in
    /// the line item's billable metric base units (before conversion to hours, GB, etc.).
    #[prost(int64, tag = "7")]
    pub amount: i64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateGrantResponse {
    #[prost(bool, tag = "1")]
    pub created: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreditSourceConfig {
    #[prost(enumeration = "CreditSource", tag = "1")]
    pub source: i32,
    #[prost(string, optional, tag = "2")]
    pub source_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RecurringCredit {
    /// Present only when type is UNITS; null for monetary types.
    #[prost(string, optional, tag = "1")]
    pub line_item_uid: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "RecurringCreditType", tag = "2")]
    pub r#type: i32,
    #[prost(uint64, tag = "3")]
    pub amount: u64,
}
/// Denomination of a RecurringCredit.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RecurringCreditType {
    Unspecified = 0,
    /// A quantity of units for a specific line item.
    Units = 1,
    /// A monetary allowance measured in cents.
    Cents = 2,
    /// A percentage-point discount: 10 = 10%.
    DiscountPercent = 3,
}
impl RecurringCreditType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "RECURRING_CREDIT_TYPE_UNSPECIFIED",
            Self::Units => "RECURRING_CREDIT_TYPE_UNITS",
            Self::Cents => "RECURRING_CREDIT_TYPE_CENTS",
            Self::DiscountPercent => "RECURRING_CREDIT_TYPE_DISCOUNT_PERCENT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "RECURRING_CREDIT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "RECURRING_CREDIT_TYPE_UNITS" => Some(Self::Units),
            "RECURRING_CREDIT_TYPE_CENTS" => Some(Self::Cents),
            "RECURRING_CREDIT_TYPE_DISCOUNT_PERCENT" => Some(Self::DiscountPercent),
            _ => None,
        }
    }
}
/// External system that granted a RecurringCredit.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CreditSource {
    Unspecified = 0,
    /// A promo code redemption.
    PromoCode = 1,
    /// A manual admin grant.
    Admin = 2,
}
impl CreditSource {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "CREDIT_SOURCE_UNSPECIFIED",
            Self::PromoCode => "CREDIT_SOURCE_PROMO_CODE",
            Self::Admin => "CREDIT_SOURCE_ADMIN",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CREDIT_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
            "CREDIT_SOURCE_PROMO_CODE" => Some(Self::PromoCode),
            "CREDIT_SOURCE_ADMIN" => Some(Self::Admin),
            _ => None,
        }
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateRecurringCreditRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    /// Required for UNITS; must be absent for monetary types.
    #[prost(string, optional, tag = "2")]
    pub line_item_uid: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "RecurringCreditType", tag = "3")]
    pub r#type: i32,
    #[prost(uint64, tag = "4")]
    pub amount: u64,
    #[prost(uint64, tag = "5")]
    pub number_of_periods: u64,
    #[prost(uint64, tag = "6")]
    pub contract_id: u64,
    #[prost(message, optional, tag = "7")]
    pub source_config: ::core::option::Option<CreditSourceConfig>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateRecurringCreditResponse {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UnitGrant {
    #[prost(string, tag = "1")]
    pub line_item_uid: ::prost::alloc::string::String,
    #[prost(oneof = "unit_grant::Amount", tags = "2, 3")]
    pub amount: ::core::option::Option<unit_grant::Amount>,
}
/// Nested message and enum types in `UnitGrant`.
pub mod unit_grant {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Amount {
        #[prost(bool, tag = "2")]
        IsUnlimited(bool),
        /// this should be expressed line item's billable metric prior to unit conversion (ie milliseconds, bytes, etc.)
        #[prost(uint64, tag = "3")]
        Units(u64),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MonetaryGrant {
    /// PERCENT amounts are percentage points: 10 = 10%
    #[prost(uint64, tag = "1")]
    pub amount: u64,
    #[prost(enumeration = "MonetaryType", tag = "2")]
    pub r#type: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ActiveGrant {
    /// Grants only apply to days between \[start_date, end_date\] (inclusive)
    /// For units, this means Grants apply to usage that was accrued during the active period.
    /// For monetary, Grants are applied to invoices created during the active period.
    #[prost(message, optional, tag = "3")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "4")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
    #[prost(oneof = "active_grant::Kind", tags = "1, 2")]
    pub kind: ::core::option::Option<active_grant::Kind>,
}
/// Nested message and enum types in `ActiveGrant`.
pub mod active_grant {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Kind {
        #[prost(message, tag = "1")]
        Unit(super::UnitGrant),
        #[prost(message, tag = "2")]
        Monetary(super::MonetaryGrant),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetActiveGrantsRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    #[prost(message, optional, tag = "3")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "4")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetActiveGrantsResponse {
    #[prost(message, repeated, tag = "1")]
    pub grants: ::prost::alloc::vec::Vec<ActiveGrant>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MonetaryType {
    Unspecified = 0,
    Cents = 1,
    Percent = 2,
}
impl MonetaryType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "MONETARY_TYPE_UNSPECIFIED",
            Self::Cents => "MONETARY_TYPE_CENTS",
            Self::Percent => "MONETARY_TYPE_PERCENT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "MONETARY_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "MONETARY_TYPE_CENTS" => Some(Self::Cents),
            "MONETARY_TYPE_PERCENT" => Some(Self::Percent),
            _ => None,
        }
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TrialConfig {
    #[prost(string, tag = "1")]
    pub line_item_uid: ::prost::alloc::string::String,
    #[prost(oneof = "trial_config::Amount", tags = "2, 3")]
    pub amount: ::core::option::Option<trial_config::Amount>,
}
/// Nested message and enum types in `TrialConfig`.
pub mod trial_config {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Amount {
        /// this should be expressed line item's billable metric prior to unit
        /// conversion (ie milliseconds, bytes, etc.)
        #[prost(uint64, tag = "2")]
        Total(u64),
        #[prost(bool, tag = "3")]
        IsUnlimited(bool),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Trial {
    #[prost(message, repeated, tag = "1")]
    pub config: ::prost::alloc::vec::Vec<TrialConfig>,
    #[prost(message, optional, tag = "2")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "3")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
    #[prost(string, optional, tag = "4")]
    pub package_uid: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetActiveTrialsRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    /// returns all trials active between \[start_date, end_date\] inclusive
    #[prost(message, optional, tag = "3")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "4")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetActiveTrialsResponse {
    #[prost(message, repeated, tag = "1")]
    pub trials: ::prost::alloc::vec::Vec<Trial>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetContractBalanceRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetContractBalanceResponse {
    #[prost(uint64, tag = "1")]
    pub balance_cents: u64,
}
/// A grant with counter-grant chains collapsed into a single effective amount.
/// Returned in drain priority order (end_date ASC, effective_amount ASC, grant_id ASC).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EffectiveGrant {
    #[prost(uint64, tag = "1")]
    pub grant_id: u64,
    #[prost(enumeration = "GrantType", tag = "2")]
    pub r#type: i32,
    #[prost(string, repeated, tag = "3")]
    pub line_item_uids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Usable amount after counter-grant collapse; always > 0.
    #[prost(int64, tag = "4")]
    pub effective_amount: i64,
    /// The grant's own active window, inclusive on both ends. These are the
    /// grant's stored dates, not clipped to the query window: the grant applies
    /// only to usage on days within \[start_date, end_date\], so a grant ending
    /// mid-window stops covering usage after end_date.
    #[prost(message, optional, tag = "5")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "6")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetEffectiveGrantsRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    /// When set, returns only grants whose line_item_uids contain this value.
    #[prost(string, optional, tag = "2")]
    pub line_item_uid: ::core::option::Option<::prost::alloc::string::String>,
    /// start_date / end_date define the query window. A grant is returned if its
    /// own \[start_date, end_date\] overlaps this window (grant.start_date \<=
    /// end_date AND grant.end_date >= start_date), inclusive on both ends. A grant
    /// that begins before the window or ends inside it is therefore included.
    /// Returned grants apply only to usage on the days each grant is itself active
    /// — a grant ending mid-window does not cover usage after its end_date.
    #[prost(message, optional, tag = "3")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "4")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEffectiveGrantsResponse {
    /// Grants with counter-chains collapsed, sorted by drain priority.
    #[prost(message, repeated, tag = "1")]
    pub effective_grants: ::prost::alloc::vec::Vec<EffectiveGrant>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EffectiveMonetaryGrant {
    /// PERCENT amounts are percentage points: 10 = 10%
    #[prost(uint64, tag = "1")]
    pub amount: u64,
    #[prost(enumeration = "EffectiveMonetaryType", tag = "2")]
    pub r#type: i32,
    #[prost(enumeration = "EffectiveMonetarySource", tag = "3")]
    pub source: i32,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetMonetaryGrantsRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMonetaryGrantsResponse {
    #[prost(message, repeated, tag = "1")]
    pub monetary_grants: ::prost::alloc::vec::Vec<EffectiveMonetaryGrant>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EffectiveMonetaryType {
    Unspecified = 0,
    Cents = 1,
    Percent = 2,
}
impl EffectiveMonetaryType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "EFFECTIVE_MONETARY_TYPE_UNSPECIFIED",
            Self::Cents => "EFFECTIVE_MONETARY_TYPE_CENTS",
            Self::Percent => "EFFECTIVE_MONETARY_TYPE_PERCENT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "EFFECTIVE_MONETARY_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "EFFECTIVE_MONETARY_TYPE_CENTS" => Some(Self::Cents),
            "EFFECTIVE_MONETARY_TYPE_PERCENT" => Some(Self::Percent),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EffectiveMonetarySource {
    Unspecified = 0,
    Balance = 1,
    RecurringCredit = 2,
}
impl EffectiveMonetarySource {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "EFFECTIVE_MONETARY_SOURCE_UNSPECIFIED",
            Self::Balance => "EFFECTIVE_MONETARY_SOURCE_BALANCE",
            Self::RecurringCredit => "EFFECTIVE_MONETARY_SOURCE_RECURRING_CREDIT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "EFFECTIVE_MONETARY_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
            "EFFECTIVE_MONETARY_SOURCE_BALANCE" => Some(Self::Balance),
            "EFFECTIVE_MONETARY_SOURCE_RECURRING_CREDIT" => Some(Self::RecurringCredit),
            _ => None,
        }
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetRecurringCreditsRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    /// The contract we're getting active credits for.
    #[prost(uint64, tag = "2")]
    pub contract_id: u64,
    /// All contract IDs for this organization. Caller should provide them in ascending order.
    #[prost(uint64, repeated, tag = "3")]
    pub contract_ids: ::prost::alloc::vec::Vec<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRecurringCreditsResponse {
    #[prost(message, repeated, tag = "1")]
    pub recurring_credits: ::prost::alloc::vec::Vec<RecurringCredit>,
}
/// Fetches Balances that were staged, but not commited to any contract.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetUnassignedBalancesRequest {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetUnassignedBalancesResponse {
    #[prost(uint64, repeated, tag = "1")]
    pub previous_contract_ids: ::prost::alloc::vec::Vec<u64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EffectiveUnitGrant {
    #[prost(string, tag = "1")]
    pub line_item_uid: ::prost::alloc::string::String,
    /// Grants only apply to days between \[start_date, end_date\] (inclusive)
    /// For units, this means Grants apply to usage that was accrued during the active period.
    /// For monetary, Grants are applied to invoices created during the active period.
    #[prost(message, optional, tag = "4")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "5")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
    #[prost(oneof = "effective_unit_grant::Amount", tags = "2, 3")]
    pub amount: ::core::option::Option<effective_unit_grant::Amount>,
}
/// Nested message and enum types in `EffectiveUnitGrant`.
pub mod effective_unit_grant {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Amount {
        #[prost(bool, tag = "2")]
        IsUnlimited(bool),
        /// this should be expressed line item's billable metric prior to unit conversion (ie milliseconds, bytes, etc.)
        #[prost(uint64, tag = "3")]
        Units(u64),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetUnitGrantsRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetUnitGrantsResponse {
    #[prost(message, repeated, tag = "1")]
    pub grants: ::prost::alloc::vec::Vec<EffectiveUnitGrant>,
}
/// Creates a staged balance carrying over the previous contract's remaining
/// balance (minus the amount used) and marks the previous contract's balance as
/// rolled over. No further Balance changes are allowed once a Balance is staged.
/// The staged balance is later assigned to the new contract via CommitRolloverBalance.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StageRolloverBalanceRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
    /// Amount used in the previous contract that will be subtracted when carrying over the balance.
    #[prost(uint64, tag = "2")]
    pub amount_used_cents: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StageRolloverBalanceResponse {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StartTrialRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    /// defaults to current date
    #[prost(message, optional, tag = "4")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    /// defaults to start_date plus 14 days
    #[prost(message, optional, tag = "5")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
    #[prost(oneof = "start_trial_request::Scope", tags = "2, 3")]
    pub scope: ::core::option::Option<start_trial_request::Scope>,
}
/// Nested message and enum types in `StartTrialRequest`.
pub mod start_trial_request {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Scope {
        /// product trials
        #[prost(string, tag = "2")]
        LineItemUid(::prost::alloc::string::String),
        /// subscription trials
        #[prost(string, tag = "3")]
        PackageUid(::prost::alloc::string::String),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StartTrialResponse {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpsertContractBalanceRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
    /// amount to be added to current balance
    #[prost(int64, tag = "2")]
    pub amount_cents: i64,
    /// There may not be a previous contract if this is the first contract for the organization.
    #[prost(oneof = "upsert_contract_balance_request::PreviousContract", tags = "3, 4")]
    pub previous_contract: ::core::option::Option<
        upsert_contract_balance_request::PreviousContract,
    >,
}
/// Nested message and enum types in `UpsertContractBalanceRequest`.
pub mod upsert_contract_balance_request {
    /// There may not be a previous contract if this is the first contract for the organization.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum PreviousContract {
        #[prost(uint64, tag = "3")]
        PreviousContractId(u64),
        #[prost(bool, tag = "4")]
        PreviousContractDoesNotExist(bool),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpsertContractBalanceResponse {
    #[prost(uint64, tag = "1")]
    pub new_balance_cents: u64,
}