sentry_protos 0.60.0

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
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
// This file is @generated by prost-build.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Date {
    #[prost(uint32, tag = "1")]
    pub year: u32,
    #[prost(uint32, tag = "2")]
    pub month: u32,
    #[prost(uint32, tag = "3")]
    pub day: u32,
}
/// Configuration for a sponsored contract. The presence of this message on a
/// BillingConfig indicates the contract is sponsored; its absence means it is
/// not.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SponsorshipConfig {
    #[deprecated]
    #[prost(enumeration = "SponsoredType", tag = "1")]
    pub sponsored_type: i32,
    /// Whether this sponsored Contract is eligible to start trials.
    #[prost(bool, tag = "2")]
    pub can_trial: bool,
    /// Whether this sponsored Contract can checkout.
    #[prost(bool, tag = "3")]
    pub can_checkout: bool,
    #[prost(enumeration = "super::super::super::common::v1::SponsoredType", tag = "4")]
    pub sponsorship_type: i32,
}
/// Configuration for what a contract will be charged for.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChargeConfig {
    #[prost(enumeration = "BillingType", tag = "1")]
    pub billing_type: i32,
    /// Whether this billing mode charges subscription fees. When true, subscription
    /// fees are charged only when they are due for renewal.
    #[prost(bool, tag = "2")]
    pub charges_subscription: bool,
    /// Whether we should charge for PAYG spend.
    #[prost(bool, tag = "3")]
    pub charges_payg: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Address {
    #[prost(string, tag = "1")]
    pub city: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub region: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub country_code: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub postal_code: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub address_line_1: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub address_line_2: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub address_line_3: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BillingConfig {
    /// The number-of-months interval the contract was signed under
    /// (1 = monthly, 12 = annual). Frozen for the life of the contract.
    #[prost(uint32, tag = "7")]
    pub month_interval: u32,
    /// Whether the org is allowed to incur pay-as-you-go usage.
    /// Credit-card orgs always support payg; invoiced orgs that should
    /// support it are an explicit override.
    #[prost(bool, tag = "8")]
    pub supports_payg: bool,
    /// Whether this is a managed (sales-assisted) subscription rather than
    /// self-serve.
    #[prost(bool, tag = "9")]
    pub is_managed: bool,
    /// Whether the org has a soft cap: usage past reserved volume is allowed
    /// (and billed) instead of hard-stopping ingestion.
    #[prost(bool, tag = "10")]
    pub has_soft_cap: bool,
    /// Sponsorship configuration. Absent means the contract is not sponsored.
    #[prost(message, optional, tag = "11")]
    pub sponsorship_config: ::core::option::Option<SponsorshipConfig>,
    #[prost(message, optional, tag = "12")]
    pub charge_config: ::core::option::Option<ChargeConfig>,
    /// Remaining fields are deprecated
    ///
    /// Use charge_config
    #[deprecated]
    #[prost(enumeration = "BillingType", tag = "1")]
    pub billing_type: i32,
    #[deprecated]
    #[prost(enumeration = "BillingChannel", tag = "2")]
    pub channel: i32,
    #[deprecated]
    #[prost(enumeration = "ExternalBillingProvider", tag = "3")]
    pub external_billing_provider: i32,
    #[deprecated]
    #[prost(message, optional, tag = "4")]
    pub address: ::core::option::Option<Address>,
    /// Use PricingConfig.billing_period_start_date and PricingConfig.billing_period_end_date
    #[deprecated]
    #[prost(message, optional, tag = "5")]
    pub contract_start_date: ::core::option::Option<Date>,
    #[deprecated]
    #[prost(message, optional, tag = "6")]
    pub contract_end_date: ::core::option::Option<Date>,
}
/// Indicates how the account is billed.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BillingType {
    Unspecified = 0,
    Invoiced = 1,
    CreditCard = 2,
    Partner = 3,
    PaygInvoiced = 4,
}
impl BillingType {
    /// 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 => "BILLING_TYPE_UNSPECIFIED",
            Self::Invoiced => "BILLING_TYPE_INVOICED",
            Self::CreditCard => "BILLING_TYPE_CREDIT_CARD",
            Self::Partner => "BILLING_TYPE_PARTNER",
            Self::PaygInvoiced => "BILLING_TYPE_PAYG_INVOICED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "BILLING_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "BILLING_TYPE_INVOICED" => Some(Self::Invoiced),
            "BILLING_TYPE_CREDIT_CARD" => Some(Self::CreditCard),
            "BILLING_TYPE_PARTNER" => Some(Self::Partner),
            "BILLING_TYPE_PAYG_INVOICED" => Some(Self::PaygInvoiced),
            _ => None,
        }
    }
}
/// The channel through which the contract is billed.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BillingChannel {
    Unspecified = 0,
    SelfServe = 1,
    Sales = 2,
    Partner = 3,
}
impl BillingChannel {
    /// 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 => "BILLING_CHANNEL_UNSPECIFIED",
            Self::SelfServe => "BILLING_CHANNEL_SELF_SERVE",
            Self::Sales => "BILLING_CHANNEL_SALES",
            Self::Partner => "BILLING_CHANNEL_PARTNER",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "BILLING_CHANNEL_UNSPECIFIED" => Some(Self::Unspecified),
            "BILLING_CHANNEL_SELF_SERVE" => Some(Self::SelfServe),
            "BILLING_CHANNEL_SALES" => Some(Self::Sales),
            "BILLING_CHANNEL_PARTNER" => Some(Self::Partner),
            _ => None,
        }
    }
}
/// Deprecated: use sentry_protos.billing.v1.common.v1.SponsoredType. Moved to
/// common/v1 so it can be shared with the pending_change service
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SponsoredType {
    Unspecified = 0,
    Education = 1,
    OpenSource = 2,
    NonProfit = 3,
    FriendsAndFamily = 4,
    FlyIo = 5,
    Nintendo = 6,
    Employee = 7,
}
impl SponsoredType {
    /// 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 => "SPONSORED_TYPE_UNSPECIFIED",
            Self::Education => "SPONSORED_TYPE_EDUCATION",
            Self::OpenSource => "SPONSORED_TYPE_OPEN_SOURCE",
            Self::NonProfit => "SPONSORED_TYPE_NON_PROFIT",
            Self::FriendsAndFamily => "SPONSORED_TYPE_FRIENDS_AND_FAMILY",
            Self::FlyIo => "SPONSORED_TYPE_FLY_IO",
            Self::Nintendo => "SPONSORED_TYPE_NINTENDO",
            Self::Employee => "SPONSORED_TYPE_EMPLOYEE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SPONSORED_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "SPONSORED_TYPE_EDUCATION" => Some(Self::Education),
            "SPONSORED_TYPE_OPEN_SOURCE" => Some(Self::OpenSource),
            "SPONSORED_TYPE_NON_PROFIT" => Some(Self::NonProfit),
            "SPONSORED_TYPE_FRIENDS_AND_FAMILY" => Some(Self::FriendsAndFamily),
            "SPONSORED_TYPE_FLY_IO" => Some(Self::FlyIo),
            "SPONSORED_TYPE_NINTENDO" => Some(Self::Nintendo),
            "SPONSORED_TYPE_EMPLOYEE" => Some(Self::Employee),
            _ => None,
        }
    }
}
/// The external billing provider used to process payments for the contract.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExternalBillingProvider {
    Unspecified = 0,
    Stripe = 1,
    Vercel = 2,
}
impl ExternalBillingProvider {
    /// 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 => "EXTERNAL_BILLING_PROVIDER_UNSPECIFIED",
            Self::Stripe => "EXTERNAL_BILLING_PROVIDER_STRIPE",
            Self::Vercel => "EXTERNAL_BILLING_PROVIDER_VERCEL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "EXTERNAL_BILLING_PROVIDER_UNSPECIFIED" => Some(Self::Unspecified),
            "EXTERNAL_BILLING_PROVIDER_STRIPE" => Some(Self::Stripe),
            "EXTERNAL_BILLING_PROVIDER_VERCEL" => Some(Self::Vercel),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Sku {
    Unspecified = 0,
    Errors = 1,
    Spans = 2,
    Replays = 3,
    PerformanceUnits = 4,
    Cron = 5,
    Uptime = 6,
    Attachments = 7,
    Profiling = 8,
    ProfilingUi = 9,
    Logs = 10,
    Seer = 11,
    SizeAnalysis = 12,
    BuildDistribution = 13,
    Autofix = 14,
    Scanner = 15,
}
impl Sku {
    /// 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 => "SKU_UNSPECIFIED",
            Self::Errors => "SKU_ERRORS",
            Self::Spans => "SKU_SPANS",
            Self::Replays => "SKU_REPLAYS",
            Self::PerformanceUnits => "SKU_PERFORMANCE_UNITS",
            Self::Cron => "SKU_CRON",
            Self::Uptime => "SKU_UPTIME",
            Self::Attachments => "SKU_ATTACHMENTS",
            Self::Profiling => "SKU_PROFILING",
            Self::ProfilingUi => "SKU_PROFILING_UI",
            Self::Logs => "SKU_LOGS",
            Self::Seer => "SKU_SEER",
            Self::SizeAnalysis => "SKU_SIZE_ANALYSIS",
            Self::BuildDistribution => "SKU_BUILD_DISTRIBUTION",
            Self::Autofix => "SKU_AUTOFIX",
            Self::Scanner => "SKU_SCANNER",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SKU_UNSPECIFIED" => Some(Self::Unspecified),
            "SKU_ERRORS" => Some(Self::Errors),
            "SKU_SPANS" => Some(Self::Spans),
            "SKU_REPLAYS" => Some(Self::Replays),
            "SKU_PERFORMANCE_UNITS" => Some(Self::PerformanceUnits),
            "SKU_CRON" => Some(Self::Cron),
            "SKU_UPTIME" => Some(Self::Uptime),
            "SKU_ATTACHMENTS" => Some(Self::Attachments),
            "SKU_PROFILING" => Some(Self::Profiling),
            "SKU_PROFILING_UI" => Some(Self::ProfilingUi),
            "SKU_LOGS" => Some(Self::Logs),
            "SKU_SEER" => Some(Self::Seer),
            "SKU_SIZE_ANALYSIS" => Some(Self::SizeAnalysis),
            "SKU_BUILD_DISTRIBUTION" => Some(Self::BuildDistribution),
            "SKU_AUTOFIX" => Some(Self::Autofix),
            "SKU_SCANNER" => Some(Self::Scanner),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PricingTier {
    #[prost(int64, tag = "1")]
    pub start: i64,
    #[prost(int64, tag = "2")]
    pub end: i64,
    #[prost(int64, tag = "3")]
    pub rate_per_unit_cpe: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TieredPricingRate {
    #[prost(message, repeated, tag = "1")]
    pub tiers: ::prost::alloc::vec::Vec<PricingTier>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SkuConfig {
    /// DEPRECATED: use billing_sku instead
    #[deprecated]
    #[prost(enumeration = "Sku", tag = "1")]
    pub sku: i32,
    /// Base price for the SKU (upgraded reserved volumes or add-on activation fees)
    #[prost(uint64, tag = "2")]
    pub base_price_cents: u64,
    #[prost(uint64, optional, tag = "3")]
    pub payg_budget_cents: ::core::option::Option<u64>,
    /// DEPRECATED: use signed reserved_units instead for support for unlimited/reserved budget categories
    #[deprecated]
    #[prost(uint64, tag = "4")]
    pub reserved_volume: u64,
    #[prost(message, optional, tag = "5")]
    pub payg_rate: ::core::option::Option<TieredPricingRate>,
    /// for reserved budget SKUs
    #[prost(message, optional, tag = "6")]
    pub reserved_rate: ::core::option::Option<TieredPricingRate>,
    #[prost(enumeration = "super::super::super::Sku", tag = "9")]
    pub billing_sku: i32,
    #[prost(oneof = "sku_config::ReservedUnits", tags = "7, 8")]
    pub reserved_units: ::core::option::Option<sku_config::ReservedUnits>,
}
/// Nested message and enum types in `SKUConfig`.
pub mod sku_config {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum ReservedUnits {
        #[prost(bool, tag = "7")]
        IsUnlimited(bool),
        /// the type communicates whether the SKU is unlimited or not, additionally reserved budget SKUs have a non-zero reserved_rate in addition to 0 reserved_units
        #[prost(uint64, tag = "8")]
        NumReservedUnits(u64),
    }
}
/// Represents a budget that is collectively used by one or more SKUs,
/// allowing multiple SKUs to draw from the same reserved budget.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SharedSkuBudget {
    /// DEPRECATED: use billing_skus instead
    #[deprecated]
    #[prost(enumeration = "Sku", repeated, packed = "false", tag = "1")]
    pub skus: ::prost::alloc::vec::Vec<i32>,
    #[prost(uint64, tag = "2")]
    pub reserved_budget_cents: u64,
    #[prost(uint64, tag = "3")]
    pub payg_budget_cents: u64,
    #[prost(enumeration = "super::super::super::Sku", repeated, tag = "4")]
    pub billing_skus: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PaygBudget {
    #[prost(uint64, tag = "1")]
    pub budget_cents: u64,
    /// Overrides package's PAYG rates; only enterprise customers can set custom PAYG rates
    #[prost(message, optional, tag = "2")]
    pub custom_payg_rate: ::core::option::Option<
        super::super::super::common::v1::TieredPricingRate,
    >,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Reservation {
    #[prost(uint64, tag = "1")]
    pub reserved_price_cents: u64,
    #[prost(oneof = "reservation::ReservedUnits", tags = "2, 3")]
    pub reserved_units: ::core::option::Option<reservation::ReservedUnits>,
}
/// Nested message and enum types in `Reservation`.
pub mod reservation {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum ReservedUnits {
        #[prost(bool, tag = "2")]
        IsUnlimited(bool),
        #[prost(uint64, tag = "3")]
        NumReservedUnits(u64),
    }
}
/// Allows usage beyond a reservation without PAYG charges.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SoftCap {
    #[prost(enumeration = "super::super::super::common::v1::SoftCapType", tag = "1")]
    pub r#type: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LineItemUids {
    #[prost(string, repeated, tag = "1")]
    pub uids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// For activating add-ons that do not necessarily require Reservation or PAYGBudget changes
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Activation {
    #[prost(enumeration = "activation::Change", tag = "1")]
    pub change: i32,
}
/// Nested message and enum types in `Activation`.
pub mod activation {
    /// A checkout operation on the activation. The default adds the activation. A
    /// contract never stores CHANGE_REMOVE. It is a request to delete the activation.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Change {
        Unspecified = 0,
        Remove = 1,
    }
    impl Change {
        /// 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 => "CHANGE_UNSPECIFIED",
                Self::Remove => "CHANGE_REMOVE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "CHANGE_UNSPECIFIED" => Some(Self::Unspecified),
                "CHANGE_REMOVE" => Some(Self::Remove),
                _ => None,
            }
        }
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserConfig {
    #[prost(message, optional, tag = "1")]
    pub payg_budget: ::core::option::Option<PaygBudget>,
    #[prost(message, optional, tag = "2")]
    pub reservation: ::core::option::Option<Reservation>,
    #[prost(message, optional, tag = "5")]
    pub activation: ::core::option::Option<Activation>,
    #[prost(message, optional, tag = "6")]
    pub soft_cap: ::core::option::Option<SoftCap>,
    #[prost(oneof = "user_config::LineItems", tags = "3, 4")]
    pub line_items: ::core::option::Option<user_config::LineItems>,
}
/// Nested message and enum types in `UserConfig`.
pub mod user_config {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum LineItems {
        #[prost(message, tag = "3")]
        SpecificItems(super::LineItemUids),
        #[prost(message, tag = "4")]
        AllItems(()),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PricingConfig {
    /// Determines when to reset quotas and charge the subscription price.
    #[prost(message, optional, tag = "3")]
    pub billing_period_start_date: ::core::option::Option<Date>,
    #[prost(message, optional, tag = "4")]
    pub billing_period_end_date: ::core::option::Option<Date>,
    /// Determines when the on demand period for invoicing the organization starts and ends, even for annual plans we bill ondemand monthly
    #[prost(message, optional, tag = "7")]
    pub ondemand_period_start_date: ::core::option::Option<Date>,
    #[prost(message, optional, tag = "8")]
    pub ondemand_period_end_date: ::core::option::Option<Date>,
    #[prost(message, optional, tag = "9")]
    pub usage_watermark_ts: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, repeated, tag = "10")]
    pub user_config: ::prost::alloc::vec::Vec<UserConfig>,
    /// DEPRECATED: use package instead.
    #[deprecated]
    #[prost(uint64, tag = "6")]
    pub base_price_cents: u64,
    /// DEPRECATED: use package/user_parameters instead.
    #[deprecated]
    #[prost(message, repeated, tag = "1")]
    pub sku_configs: ::prost::alloc::vec::Vec<SkuConfig>,
    /// DEPRECATED: use package/user_parameters instead.
    #[deprecated]
    #[prost(message, repeated, tag = "2")]
    pub shared_sku_budgets: ::prost::alloc::vec::Vec<SharedSkuBudget>,
    /// DEPRECATED: use user_parameters instead
    #[deprecated]
    #[prost(uint64, tag = "5")]
    pub max_spend_cents: u64,
}
/// This is not the same as LineItemDetails, it includes
/// items not related to the package such as tax. Each line item may carry an
/// optional type that classifies it (e.g. "tax") so consumers can treat it
/// specially without inspecting the description.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InvoiceLineItem {
    /// Intentionally not a uint (some line items could be discounts)
    #[prost(int64, tag = "1")]
    pub amount_cents: i64,
    #[prost(string, optional, tag = "2")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional classifier for the line item, e.g. "tax". Unset for ordinary
    /// priced line items.
    #[prost(string, optional, tag = "3")]
    pub r#type: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Invoice {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
    #[prost(message, repeated, tag = "2")]
    pub line_items: ::prost::alloc::vec::Vec<InvoiceLineItem>,
    /// Not just a sum of line items since there may be credit applied
    #[prost(uint64, tag = "3")]
    pub amount_billed: u64,
    #[prost(uint64, tag = "4")]
    pub organization_id: u64,
    #[prost(bool, tag = "5")]
    pub paid: bool,
    #[prost(message, optional, tag = "6")]
    pub date_added: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(string, tag = "7")]
    pub guid: ::prost::alloc::string::String,
    #[prost(bool, tag = "8")]
    pub needs_charged: bool,
    #[prost(message, optional, tag = "9")]
    pub address: ::core::option::Option<super::super::super::common::v1::Address>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OptionValue {
    #[prost(oneof = "option_value::Value", tags = "1, 2, 3")]
    pub value: ::core::option::Option<option_value::Value>,
}
/// Nested message and enum types in `OptionValue`.
pub mod option_value {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Value {
        #[prost(string, tag = "1")]
        StringValue(::prost::alloc::string::String),
        #[prost(int64, tag = "2")]
        IntValue(i64),
        #[prost(bool, tag = "3")]
        BoolValue(bool),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FeatureOption {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(bool, tag = "2")]
    pub enabled: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FeatureOptions {
    #[prost(message, repeated, tag = "1")]
    pub options: ::prost::alloc::vec::Vec<FeatureOption>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MetadataOption {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub value: ::core::option::Option<OptionValue>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetadataOptions {
    #[prost(message, repeated, tag = "1")]
    pub options: ::prost::alloc::vec::Vec<MetadataOption>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContractMetadata {
    #[prost(uint64, tag = "1")]
    pub id: u64,
    #[prost(uint64, tag = "2")]
    pub organization_id: u64,
    /// The set of BillingRules that the BillingRulesEngine has to execute for this contract.
    #[prost(string, tag = "3")]
    pub ruleset_version: ::prost::alloc::string::String,
    /// Catch-all for overrides and information not covered above.
    #[prost(message, optional, tag = "6")]
    pub custom_options: ::core::option::Option<MetadataOptions>,
    #[prost(message, optional, tag = "7")]
    pub billing_features: ::core::option::Option<super::super::super::FeatureOptions>,
    #[prost(string, tag = "9")]
    pub package_uid: ::prost::alloc::string::String,
    #[prost(uint64, optional, tag = "10")]
    pub previous_id: ::core::option::Option<u64>,
    #[deprecated]
    #[prost(uint64, tag = "8")]
    pub package_id: u64,
    /// Includes information like plan ID, tier, etc.
    #[deprecated]
    #[prost(message, optional, tag = "4")]
    pub package_metadata: ::core::option::Option<MetadataOptions>,
    /// Entitlements, used in frontend features or gating access to certain features.
    ///
    /// DEPRECATED: use billing_features instead
    #[deprecated]
    #[prost(message, optional, tag = "5")]
    pub features: ::core::option::Option<FeatureOptions>,
}
/// A sparse override of the package retention defaults for one customer and one
/// billing data category.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RetentionOverride {
    /// The billing data category this override applies to. Package defaults and
    /// contract overrides use the same billing category identity.
    #[prost(enumeration = "super::super::super::DataCategory", tag = "1")]
    pub category: i32,
    /// The standard retention in calendar days. This is the full-fidelity
    /// retention. If this field is absent, there is no standard override. A present
    /// value must be positive.
    #[prost(uint32, optional, tag = "2")]
    pub standard_days: ::core::option::Option<u32>,
    /// The downsampled retention in calendar days. If this field is absent, there
    /// is no downsampled override. A present value must be positive. A complete
    /// package setting can use zero, but a contract override cannot.
    #[prost(uint32, optional, tag = "3")]
    pub downsampled_days: ::core::option::Option<u32>,
}
/// The contract-owned retention overrides. A service layers these overrides on
/// top of the package defaults.
///
/// This message is raw sparse input to effective-retention resolution. It is not
/// the resolved policy. If a field is absent, that field falls through to its
/// package retention chain.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetentionConfig {
    /// The organization-wide retention in calendar days. This field is a temporary
    /// legacy-compatible value. If this field is absent, the organization-wide
    /// layer does not apply. A present value must be positive. This value applies
    /// to the standard retention and to each downsampled representation the package
    /// declares.
    #[prost(uint32, optional, tag = "1")]
    pub organization_days: ::core::option::Option<u32>,
    /// The per-category sparse overrides. Each category has one entry at most.
    #[prost(message, repeated, tag = "2")]
    pub overrides: ::prost::alloc::vec::Vec<RetentionOverride>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Contract {
    #[prost(message, optional, tag = "1")]
    pub metadata: ::core::option::Option<ContractMetadata>,
    #[prost(message, optional, tag = "2")]
    pub billing_config: ::core::option::Option<BillingConfig>,
    #[prost(message, optional, tag = "3")]
    pub pricing_config: ::core::option::Option<PricingConfig>,
    #[prost(message, optional, tag = "4")]
    pub retention_config: ::core::option::Option<RetentionConfig>,
}
/// Applies a single user config to a contract immediately, repointing the
/// contract's live parameters. Used internally by add_user_configs (there is no
/// standalone service endpoint), mirroring how add_pending_user_config stages a
/// single pending config.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyImmediateUserConfigRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
    #[prost(message, optional, tag = "2")]
    pub user_config: ::core::option::Option<UserConfig>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ApplyImmediateUserConfigResponse {
    /// True when a new parameter was added for the config's scope; false when an
    /// existing parameter was repointed.
    #[prost(bool, tag = "1")]
    pub created: bool,
}
/// Applies a batch of user-config changes to a contract in one call. The
/// `immediate` configs take effect on the contract now; the `pending` configs
/// are staged for the next billing period. Grouping both in a single request
/// lets the contract service apply them atomically, so a checkout change that
/// resolves to both an immediate and a pending part cannot land half-applied.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddUserConfigsRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
    /// Configs applied to the contract immediately.
    #[prost(message, repeated, tag = "2")]
    pub immediate: ::prost::alloc::vec::Vec<UserConfig>,
    /// Configs staged to take effect at the next billing period. Mirrors the shape
    /// add_pending_user_config accepts so they can be forwarded without conversion.
    #[prost(message, repeated, tag = "3")]
    pub pending: ::prost::alloc::vec::Vec<
        super::super::super::common::v1::PendingUserConfig,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddUserConfigsResponse {
    /// Per-config results, in the same order as the request's `immediate` list.
    #[prost(message, repeated, tag = "1")]
    pub immediate: ::prost::alloc::vec::Vec<ApplyImmediateUserConfigResponse>,
    /// Per-config results, in the same order as the request's `pending` list.
    #[prost(message, repeated, tag = "2")]
    pub pending: ::prost::alloc::vec::Vec<
        super::super::pending_change::v1::AddPendingUserConfigResponse,
    >,
}
/// Atomically claims an unpaid PlatformInvoice for charging by stamping
/// manual_payment_started_at. The same column is claimed by both the
/// manual Pay Now flow (via this endpoint) and the automated invoicing
/// job (inline in get_uncharged_invoices), so this write races on the
/// shared lock -- only one actor holds a claim at a time. Failed claims
/// surface as updated=false, letting the caller distinguish "already
/// paid" from "already claimed by another actor" by inspecting the
/// invoice state.
///
/// The column name is legacy: this stamp was originally set only on
/// manual Pay Now clicks, hence the "manual_payment_started_at" name.
/// It now doubles as the shared lock for the automated path too, but
/// the DB column and Python attribute must stay as manual_payment_started_at
/// -- a RenameField migration is blocked by django-zero-downtime-migrations
/// (unsafe column rename), and an attribute-only rename via db_column=
/// would still break old worker instances mid-deploy. The Python-side
/// surface has been generalized (charge_lock_inactive predicate,
/// CHARGE_LOCK_DURATION constant) to reflect the shared semantics.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClaimChargeLockRequest {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClaimChargeLockResponse {
    #[prost(bool, tag = "1")]
    pub updated: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateContractRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    #[prost(string, tag = "2")]
    pub package_uid: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "3")]
    pub user_configs: ::prost::alloc::vec::Vec<UserConfig>,
    #[prost(message, repeated, tag = "4")]
    pub line_items: ::prost::alloc::vec::Vec<InvoiceLineItem>,
    #[prost(message, optional, tag = "5")]
    pub address: ::core::option::Option<super::super::super::common::v1::Address>,
    /// The customer's chosen cadence. Must be one of the package's
    /// supported_month_intervals. If unset, defaults to the package's first
    /// supported interval.
    #[prost(uint32, tag = "6")]
    pub month_interval: u32,
    /// How the contract is billed. If unset (BILLING_TYPE_UNSPECIFIED), the
    /// contract defaults to credit-card.
    #[prost(enumeration = "BillingType", tag = "7")]
    pub billing_type: i32,
    /// Whether usage past reserved volume is allowed (and billed) instead of
    /// hard-stopping ingestion.
    #[prost(bool, tag = "8")]
    pub has_soft_cap: bool,
    /// The tax provider's reference for the tax document opened for this invoice.
    /// When set, the contract service records it on the created invoice as a
    /// pending tax transaction atomically with invoice creation. Unset means no
    /// tax document was opened.
    #[prost(string, optional, tag = "9")]
    pub tax_transaction_code: ::core::option::Option<::prost::alloc::string::String>,
    /// DEPRECATED: used sponsorship_type instead.
    #[deprecated]
    #[prost(enumeration = "SponsoredType", optional, tag = "10")]
    pub sponsored_type: ::core::option::Option<i32>,
    /// The sponsored type of the contract. If unset, then this is a non-sponsored
    /// contract.
    #[prost(
        enumeration = "super::super::super::common::v1::SponsoredType",
        optional,
        tag = "11"
    )]
    pub sponsorship_type: ::core::option::Option<i32>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateContractResponse {
    #[prost(uint64, tag = "1")]
    pub id: u64,
    #[prost(uint64, tag = "2")]
    pub invoice_id: u64,
    #[prost(string, tag = "3")]
    pub invoice_guid: ::prost::alloc::string::String,
    #[prost(bool, tag = "4")]
    pub needs_charge: bool,
    #[prost(uint64, tag = "5")]
    pub amount_billed: u64,
}
/// Ends a contract immediately, regardless of its scheduled end date.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EndContractImmediatelyRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EndContractImmediatelyResponse {
    /// True if a matching contract was found and updated.
    #[prost(bool, tag = "1")]
    pub updated: bool,
}
/// Locates a PlatformInvoice by guid alone. Used by webhook handlers that have
/// the invoice guid in a Stripe event's metadata but haven't resolved the
/// parent organization yet -- the org-scoped GetInvoice isn't a fit. Returns
/// just identifying fields so callers don't need to handle the full Invoice
/// proto when all they want is to thread invoice_id / organization_id into
/// another service call.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FindInvoiceByGuidRequest {
    #[prost(string, tag = "1")]
    pub invoice_guid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FindInvoiceByGuidResponse {
    /// Unset when no PlatformInvoice matches the guid. Callers should treat
    /// that as "this Stripe charge belongs to legacy billing, not platform"
    /// and fall through accordingly.
    #[prost(uint64, optional, tag = "1")]
    pub invoice_id: ::core::option::Option<u64>,
    /// Set whenever `invoice_id` is set; unset otherwise.
    #[prost(uint64, optional, tag = "2")]
    pub organization_id: ::core::option::Option<u64>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAllContractsForOrganizationRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAllContractsForOrganizationResponse {
    #[prost(message, repeated, tag = "1")]
    pub contracts: ::prost::alloc::vec::Vec<Contract>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetContractRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    /// If provided, returns the Contract active on this date. Otherwise, returns the current Contract.
    #[prost(message, optional, tag = "2")]
    pub date: ::core::option::Option<super::super::super::Date>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSpecificContractRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetContractResponse {
    #[prost(message, optional, tag = "1")]
    pub contract: ::core::option::Option<Contract>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetInvoiceRequest {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
    #[prost(string, tag = "2")]
    pub invoice_guid: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub organization_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInvoiceResponse {
    #[prost(message, optional, tag = "1")]
    pub invoice: ::core::option::Option<Invoice>,
}
/// Batch-resolves PlatformInvoice ids to their guids. Caller is responsible
/// for passing only ids it has the right to see; this endpoint does not
/// filter by organization. Missing ids are silently omitted from the
/// response.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetInvoiceGuidsForIdsRequest {
    #[prost(uint64, repeated, tag = "1")]
    pub invoice_ids: ::prost::alloc::vec::Vec<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInvoiceGuidsForIdsResponse {
    /// Mapping from invoice id to guid for every invoice that was found.
    /// Empty when the request supplied no ids or none of them matched.
    #[prost(map = "uint64, string", tag = "1")]
    pub invoice_guids: ::std::collections::HashMap<u64, ::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetUnchargedInvoicesRequest {
    /// Returns Invoices whose current billing period ends before this time and
    /// have not yet been charged for the current period.
    #[prost(message, optional, tag = "1")]
    pub current_ts: ::core::option::Option<::prost_types::Timestamp>,
    /// Maximum number of invoices to return in the response. If more invoices
    /// match the request than this limit, the response will have truncated set
    /// to true.
    #[prost(uint32, tag = "2")]
    pub max_items: u32,
    #[prost(uint32, optional, tag = "3")]
    pub offset: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetUnchargedInvoicesResponse {
    #[prost(uint64, repeated, tag = "1")]
    pub invoice_ids: ::prost::alloc::vec::Vec<u64>,
    /// True if additional matching invoices existed beyond max_items and were
    /// not included in this response.
    #[prost(bool, tag = "2")]
    pub truncated: bool,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetUninvoicedContractsRequest {
    /// Returns Contracts whose current billing period ends before this time and
    /// have not yet been invoiced for the current period.
    #[prost(message, optional, tag = "1")]
    pub current_ts: ::core::option::Option<::prost_types::Timestamp>,
    /// Maximum number of contracts to return in the response. If more contracts
    /// match the request than this limit, the response will have truncated set
    /// to true.
    #[prost(uint32, tag = "2")]
    pub max_items: u32,
    #[prost(uint32, optional, tag = "3")]
    pub offset: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetUninvoicedContractsResponse {
    /// DEPRECATED: use contract_ids instead
    #[deprecated]
    #[prost(message, repeated, tag = "1")]
    pub contracts: ::prost::alloc::vec::Vec<Contract>,
    /// True if additional matching contracts existed beyond max_items and were
    /// not included in this response.
    #[prost(bool, tag = "2")]
    pub truncated: bool,
    #[prost(uint64, repeated, tag = "3")]
    pub contract_ids: ::prost::alloc::vec::Vec<u64>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListInvoicesRequest {
    /// Only invoices owned by this organization are returned.
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    /// Maximum number of invoices to return in the response. If more invoices
    /// match the request than this limit, the response will have truncated set
    /// to true and next_offset populated for the following page.
    #[prost(uint32, tag = "2")]
    pub max_items: u32,
    /// Zero-based offset into the result set. Pair with max_items to page
    /// through results.
    #[prost(uint32, optional, tag = "3")]
    pub offset: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInvoicesResponse {
    /// Invoices for the requested organization, ordered newest-first by
    /// date_added.
    #[prost(message, repeated, tag = "1")]
    pub invoices: ::prost::alloc::vec::Vec<Invoice>,
    /// True if additional matching invoices existed beyond max_items and were
    /// not included in this response.
    #[prost(bool, tag = "2")]
    pub truncated: bool,
    /// Offset to use in a subsequent ListInvoicesRequest to fetch the next
    /// page. Only set when truncated is true.
    #[prost(uint32, optional, tag = "3")]
    pub next_offset: ::core::option::Option<u32>,
    /// Total number of invoices matching the request, ignoring offset and
    /// max_items.
    #[prost(uint32, tag = "4")]
    pub total: u32,
}
/// Marks an invoice as paid and clears its needs_charged flag so it is no longer
/// returned by GetUnchargedInvoices.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MarkInvoicePaidRequest {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MarkInvoicePaidResponse {
    /// True if a matching invoice was found and updated.
    #[prost(bool, tag = "1")]
    pub updated: bool,
    /// The updated invoice; unset when updated is false.
    #[prost(message, optional, tag = "2")]
    pub invoice: ::core::option::Option<Invoice>,
}
/// Records a failed charge attempt against an invoice.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RecordFailedChargeAttemptRequest {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RecordFailedChargeAttemptResponse {
    /// True if a matching invoice was found and updated.
    #[prost(bool, tag = "1")]
    pub updated: bool,
    /// Post-update attempt_count on the invoice.
    #[prost(uint32, tag = "2")]
    pub attempt_count: u32,
    /// Post-update next_payment_attempt on the invoice. Unset if the retry
    /// schedule has been exhausted and no further automatic retries will run.
    #[prost(message, optional, tag = "3")]
    pub next_payment_attempt: ::core::option::Option<::prost_types::Timestamp>,
}
/// Releases the shared charge lock on an unpaid invoice by NULLing
/// manual_payment_started_at. Used by the manual Pay Now endpoint when
/// the Stripe PaymentIntent.create call fails after the lock was
/// acquired -- releasing keeps the inline-cutoff window from delaying
/// automated retries by up to 24h. See endpoint_claim_charge_lock.proto
/// for the paired claim endpoint and the legacy column-name context.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReleaseChargeLockRequest {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReleaseChargeLockResponse {
    #[prost(bool, tag = "1")]
    pub updated: bool,
}
/// DEPRECATED: replaced by ReleaseChargeLockRequest /
/// ReleaseChargeLockResponse in endpoint_release_charge_lock.proto.
/// The rename generalized the semantics from a "manual payment lock"
/// (implying manual-only) to a shared "charge lock" that both the
/// manual Pay Now flow and the automated invoicing job write against
/// the same column (manual_payment_started_at).
///
/// The messages are retained here (rather than being deleted) so buf's
/// breaking-change check stays green while consumers migrate. Remove on the
/// next major version bump.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReleaseManualPaymentLockRequest {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReleaseManualPaymentLockResponse {
    #[prost(bool, tag = "1")]
    pub updated: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RetryChargeRequest {
    #[prost(string, tag = "1")]
    pub invoice_guid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RetryChargeResponse {
    #[prost(bool, tag = "1")]
    pub updated: bool,
}
/// Creates a new contract for a new billing period. Closes out the current contract by
/// creating an invoice and setting the last usage date
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RolloverContractRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
    #[prost(message, optional, tag = "2")]
    pub last_usage_ts: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, repeated, tag = "3")]
    pub line_items: ::prost::alloc::vec::Vec<InvoiceLineItem>,
    #[prost(message, optional, tag = "4")]
    pub address: ::core::option::Option<super::super::super::common::v1::Address>,
    /// The pending change to apply to the new contract, if any. Unset means no
    /// pending change is being applied during this rollover.
    #[prost(message, optional, tag = "5")]
    pub pending_change: ::core::option::Option<
        super::super::super::common::v1::PendingChange,
    >,
    /// The tax provider's reference for the tax document opened for this invoice.
    /// When set, the contract service records it on the new invoice as a pending
    /// tax transaction atomically with invoice creation, so the document can later
    /// be committed or voided. Unset means no tax document was opened.
    #[prost(string, optional, tag = "7")]
    pub tax_transaction_code: ::core::option::Option<::prost::alloc::string::String>,
    /// Roll the contract over as of now instead of at its period end: the current
    /// contract is closed immediately and the new contract starts now.
    #[prost(bool, tag = "8")]
    pub immediate: bool,
    /// Whether the requested change should result in a new billing period.
    #[prost(bool, tag = "9")]
    pub start_new_term: bool,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RolloverContractResponse {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
    #[prost(bool, tag = "2")]
    pub needs_charge: bool,
    #[prost(uint64, tag = "3")]
    pub amount_billed: u64,
    #[prost(uint64, tag = "4")]
    pub new_contract_id: u64,
}
/// DEPRECATED: replaced by ClaimChargeLockRequest / ClaimChargeLockResponse
/// in endpoint_claim_charge_lock.proto. The rename generalized the
/// semantics -- the same column (manual_payment_started_at) is now
/// claimed by both the manual Pay Now flow and the automated invoicing
/// job, so "start_manual_payment" no longer describes the shared lock.
///
/// The messages are retained here (rather than being deleted) so buf's
/// breaking-change check stays green while consumers migrate. Remove on the
/// next major version bump.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StartManualPaymentRequest {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StartManualPaymentResponse {
    #[prost(bool, tag = "1")]
    pub updated: bool,
}