helm-sdk 0.10.0

Rust SDK for HELM — fail-closed tool calling for AI agents
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
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Effect {
    #[prost(string, tag = "1")]
    pub effect_type: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub effect_id: ::prost::alloc::string::String,
    /// JSON-encoded parameters
    #[prost(bytes = "vec", tag = "3")]
    pub params: ::prost::alloc::vec::Vec<u8>,
    #[prost(string, tag = "4")]
    pub budget_id: ::prost::alloc::string::String,
}
/// Deterministic advisory-classifier evidence. This is informational by
/// default; a Guardian policy may only escalate an explicitly configured score,
/// coverage, or availability condition.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SemanticThreatAssessment {
    #[prost(bool, tag = "1")]
    pub available: bool,
    #[prost(string, tag = "2")]
    pub model_version: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub model_hash: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub expected_model_hash: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub failure_reason: ::prost::alloc::string::String,
    #[prost(uint32, tag = "6")]
    pub threshold_bp: u32,
    #[prost(uint32, tag = "7")]
    pub max_bp: u32,
    #[prost(string, tag = "8")]
    pub nearest_class: ::prost::alloc::string::String,
    #[prost(bool, tag = "9")]
    pub flagged: bool,
    #[prost(bool, tag = "10")]
    pub input_truncated: bool,
}
/// Guardian-owned threat evidence bound by decision_record.v3 whenever it is
/// present. The input hash is a reference, never caller-controlled policy data.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ThreatScanReference {
    #[prost(string, tag = "1")]
    pub scan_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub max_severity: ::prost::alloc::string::String,
    #[prost(uint32, tag = "3")]
    pub finding_count: u32,
    #[prost(string, tag = "4")]
    pub trust_level: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub input_hash: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "6")]
    pub semantic: ::core::option::Option<SemanticThreatAssessment>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DecisionRecord {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(enumeration = "Verdict", tag = "3")]
    pub verdict: i32,
    #[prost(string, tag = "4")]
    pub reason: ::prost::alloc::string::String,
    #[prost(enumeration = "ReasonCode", tag = "5")]
    pub reason_code: i32,
    #[prost(string, tag = "6")]
    pub effect_digest: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub requirement_set_hash: ::prost::alloc::string::String,
    #[prost(string, tag = "8")]
    pub signature: ::prost::alloc::string::String,
    #[prost(string, tag = "9")]
    pub signer_key_id: ::prost::alloc::string::String,
    #[prost(string, tag = "10")]
    pub policy_ref: ::prost::alloc::string::String,
    #[prost(string, tag = "11")]
    pub policy_decision_hash: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "12")]
    pub input_context: ::prost::alloc::vec::Vec<u8>,
    /// Product request identity (X-Helm-Correlation-ID) this decision was made
    /// for — the stable join key across lifecycle events, receipts, and
    /// evidence. Optional; outside the decision signature until HELM-303.
    #[prost(string, tag = "13")]
    pub correlation_id: ::prost::alloc::string::String,
    /// HELM-303 decision.v2 / decision.v3 signing envelope fields.
    #[prost(string, tag = "14")]
    pub signature_version: ::prost::alloc::string::String,
    #[prost(string, tag = "15")]
    pub phenotype_hash: ::prost::alloc::string::String,
    #[prost(string, tag = "16")]
    pub policy_content_hash: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "17")]
    pub threat_scan: ::core::option::Option<ThreatScanReference>,
    /// decision_record.v4 authorization and signer bindings. These are appended
    /// so current V3 Guardian threat evidence keeps its established wire field.
    #[prost(string, tag = "18")]
    pub subject_id: ::prost::alloc::string::String,
    #[prost(string, tag = "19")]
    pub action: ::prost::alloc::string::String,
    #[prost(string, tag = "20")]
    pub resource: ::prost::alloc::string::String,
    #[prost(string, tag = "21")]
    pub signature_type: ::prost::alloc::string::String,
    /// The full open-string ReasonCode bound by the V2/V3/V4 preimages. The
    /// legacy reason_code field above remains a closed enum for compatibility.
    #[prost(string, tag = "22")]
    pub reason_code_text: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthorizedExecutionIntent {
    #[prost(string, tag = "1")]
    pub intent_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub decision_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub effect_id: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "4")]
    pub issued_at: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "5")]
    pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(string, tag = "6")]
    pub signature: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub signer_key_id: ::prost::alloc::string::String,
    #[prost(string, tag = "8")]
    pub principal: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Receipt {
    #[prost(string, tag = "1")]
    pub receipt_version: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub receipt_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub decision_id: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub effect_id: ::prost::alloc::string::String,
    #[prost(enumeration = "Verdict", tag = "5")]
    pub verdict: i32,
    #[prost(string, tag = "6")]
    pub principal: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub tool: ::prost::alloc::string::String,
    #[prost(string, tag = "8")]
    pub action: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "9")]
    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(uint64, tag = "10")]
    pub lamport: u64,
    #[prost(string, tag = "11")]
    pub proofgraph_node: ::prost::alloc::string::String,
    #[prost(string, tag = "12")]
    pub signature: ::prost::alloc::string::String,
    #[prost(string, tag = "13")]
    pub signer_key_id: ::prost::alloc::string::String,
    #[prost(string, tag = "14")]
    pub payload_hash: ::prost::alloc::string::String,
    #[prost(enumeration = "ReasonCode", tag = "15")]
    pub reason_code: i32,
    #[prost(map = "string, string", tag = "16")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Product request identity (X-Helm-Correlation-ID) this receipt belongs
    /// to. Optional; outside the receipt signature until HELM-303.
    #[prost(string, tag = "17")]
    pub correlation_id: ::prost::alloc::string::String,
    /// HELM-303 receipt.v5 signing envelope fields. The existing verdict and
    /// reason_code fields are also signed by receipt.v5.
    #[prost(string, tag = "18")]
    pub signature_version: ::prost::alloc::string::String,
    #[prost(string, tag = "19")]
    pub status: ::prost::alloc::string::String,
    #[prost(string, tag = "20")]
    pub output_hash: ::prost::alloc::string::String,
    #[prost(string, tag = "21")]
    pub prev_hash: ::prost::alloc::string::String,
    #[prost(string, tag = "22")]
    pub args_hash: ::prost::alloc::string::String,
    #[prost(string, tag = "23")]
    pub policy_hash: ::prost::alloc::string::String,
    #[prost(string, tag = "24")]
    pub session_id: ::prost::alloc::string::String,
    /// The registered reason code as an open string (HELM-747). This is the
    /// authoritative field: the closed reason_code enum above represents only
    /// 18 of the registry's codes and reads every other code as UNSPECIFIED.
    #[prost(string, tag = "25")]
    pub reason_code_text: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PdpRequest {
    #[prost(message, optional, tag = "1")]
    pub effect: ::core::option::Option<Effect>,
    #[prost(message, optional, tag = "2")]
    pub subject: ::core::option::Option<SubjectDescriptor>,
    #[prost(message, optional, tag = "3")]
    pub context: ::core::option::Option<ContextDescriptor>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubjectDescriptor {
    #[prost(string, tag = "1")]
    pub principal: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub tenant: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "3")]
    pub roles: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContextDescriptor {
    #[prost(string, tag = "1")]
    pub jurisdiction: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub environment: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "3")]
    pub time_window_start: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "4")]
    pub time_window_end: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PdpResponse {
    #[prost(bool, tag = "1")]
    pub allow: bool,
    #[prost(enumeration = "ReasonCode", tag = "2")]
    pub reason_code: i32,
    #[prost(string, tag = "3")]
    pub policy_ref: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub decision_hash: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "5")]
    pub obligations: ::prost::alloc::vec::Vec<Obligation>,
    /// The registered reason code as an open string (HELM-747). This is the
    /// authoritative field: the closed reason_code enum above represents only
    /// 18 of the registry's codes and reads every other code as UNSPECIFIED.
    #[prost(string, tag = "6")]
    pub reason_code_text: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Obligation {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub r#type: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub description: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "4")]
    pub deadline: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EffectRequest {
    #[prost(message, optional, tag = "1")]
    pub effect: ::core::option::Option<Effect>,
    #[prost(string, tag = "2")]
    pub principal: ::prost::alloc::string::String,
    #[prost(map = "string, string", tag = "3")]
    pub context: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EffectResponse {
    #[prost(enumeration = "Verdict", tag = "1")]
    pub verdict: i32,
    #[prost(enumeration = "ReasonCode", tag = "2")]
    pub reason_code: i32,
    #[prost(string, tag = "3")]
    pub reason: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "4")]
    pub receipt: ::core::option::Option<Receipt>,
    #[prost(message, optional, tag = "5")]
    pub intent: ::core::option::Option<AuthorizedExecutionIntent>,
    /// The registered reason code as an open string (HELM-747). This is the
    /// authoritative field: the closed reason_code enum above represents only
    /// 18 of the registry's codes and reads every other code as UNSPECIFIED.
    #[prost(string, tag = "6")]
    pub reason_code_text: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionResult {
    #[prost(string, tag = "1")]
    pub intent_id: ::prost::alloc::string::String,
    #[prost(bool, tag = "2")]
    pub success: bool,
    #[prost(bytes = "vec", tag = "3")]
    pub output: ::prost::alloc::vec::Vec<u8>,
    #[prost(string, tag = "4")]
    pub error_message: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "5")]
    pub completed_at: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletionReceipt {
    #[prost(message, optional, tag = "1")]
    pub receipt: ::core::option::Option<Receipt>,
    #[prost(string, tag = "2")]
    pub proofgraph_node: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Verdict {
    Unspecified = 0,
    Allow = 1,
    Deny = 2,
    Escalate = 3,
}
impl Verdict {
    /// 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 => "VERDICT_UNSPECIFIED",
            Self::Allow => "VERDICT_ALLOW",
            Self::Deny => "VERDICT_DENY",
            Self::Escalate => "VERDICT_ESCALATE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "VERDICT_UNSPECIFIED" => Some(Self::Unspecified),
            "VERDICT_ALLOW" => Some(Self::Allow),
            "VERDICT_DENY" => Some(Self::Deny),
            "VERDICT_ESCALATE" => Some(Self::Escalate),
            _ => None,
        }
    }
}
/// Legacy closed enum. It holds 18 of the codes in
/// protocols/json-schemas/reason-codes/reason-codes-v1.json, the only reason-code
/// registry, and every other code decodes as REASON_CODE_UNSPECIFIED. Read the
/// open-string reason_code_text field beside each use instead. No values are
/// added here; scripts/ci/gen_reason_codes.py checks that every value is a
/// registry code and that every use has reason_code_text beside it.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ReasonCode {
    Unspecified = 0,
    PolicyViolation = 1,
    NoPolicyDefined = 2,
    PrgEvaluationError = 3,
    MissingRequirement = 4,
    PdpDeny = 5,
    PdpError = 6,
    BudgetExceeded = 7,
    BudgetError = 8,
    EnvelopeInvalid = 9,
    SchemaViolation = 10,
    TemporalIntervention = 11,
    TemporalThrottle = 12,
    SandboxViolation = 13,
    ProvenanceFailure = 14,
    VerificationFailure = 15,
    TenantIsolation = 16,
    JurisdictionViolation = 17,
    SemanticThreatReviewRequired = 18,
}
impl ReasonCode {
    /// 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 => "REASON_CODE_UNSPECIFIED",
            Self::PolicyViolation => "REASON_CODE_POLICY_VIOLATION",
            Self::NoPolicyDefined => "REASON_CODE_NO_POLICY_DEFINED",
            Self::PrgEvaluationError => "REASON_CODE_PRG_EVALUATION_ERROR",
            Self::MissingRequirement => "REASON_CODE_MISSING_REQUIREMENT",
            Self::PdpDeny => "REASON_CODE_PDP_DENY",
            Self::PdpError => "REASON_CODE_PDP_ERROR",
            Self::BudgetExceeded => "REASON_CODE_BUDGET_EXCEEDED",
            Self::BudgetError => "REASON_CODE_BUDGET_ERROR",
            Self::EnvelopeInvalid => "REASON_CODE_ENVELOPE_INVALID",
            Self::SchemaViolation => "REASON_CODE_SCHEMA_VIOLATION",
            Self::TemporalIntervention => "REASON_CODE_TEMPORAL_INTERVENTION",
            Self::TemporalThrottle => "REASON_CODE_TEMPORAL_THROTTLE",
            Self::SandboxViolation => "REASON_CODE_SANDBOX_VIOLATION",
            Self::ProvenanceFailure => "REASON_CODE_PROVENANCE_FAILURE",
            Self::VerificationFailure => "REASON_CODE_VERIFICATION_FAILURE",
            Self::TenantIsolation => "REASON_CODE_TENANT_ISOLATION",
            Self::JurisdictionViolation => "REASON_CODE_JURISDICTION_VIOLATION",
            Self::SemanticThreatReviewRequired => {
                "REASON_CODE_SEMANTIC_THREAT_REVIEW_REQUIRED"
            }
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "REASON_CODE_UNSPECIFIED" => Some(Self::Unspecified),
            "REASON_CODE_POLICY_VIOLATION" => Some(Self::PolicyViolation),
            "REASON_CODE_NO_POLICY_DEFINED" => Some(Self::NoPolicyDefined),
            "REASON_CODE_PRG_EVALUATION_ERROR" => Some(Self::PrgEvaluationError),
            "REASON_CODE_MISSING_REQUIREMENT" => Some(Self::MissingRequirement),
            "REASON_CODE_PDP_DENY" => Some(Self::PdpDeny),
            "REASON_CODE_PDP_ERROR" => Some(Self::PdpError),
            "REASON_CODE_BUDGET_EXCEEDED" => Some(Self::BudgetExceeded),
            "REASON_CODE_BUDGET_ERROR" => Some(Self::BudgetError),
            "REASON_CODE_ENVELOPE_INVALID" => Some(Self::EnvelopeInvalid),
            "REASON_CODE_SCHEMA_VIOLATION" => Some(Self::SchemaViolation),
            "REASON_CODE_TEMPORAL_INTERVENTION" => Some(Self::TemporalIntervention),
            "REASON_CODE_TEMPORAL_THROTTLE" => Some(Self::TemporalThrottle),
            "REASON_CODE_SANDBOX_VIOLATION" => Some(Self::SandboxViolation),
            "REASON_CODE_PROVENANCE_FAILURE" => Some(Self::ProvenanceFailure),
            "REASON_CODE_VERIFICATION_FAILURE" => Some(Self::VerificationFailure),
            "REASON_CODE_TENANT_ISOLATION" => Some(Self::TenantIsolation),
            "REASON_CODE_JURISDICTION_VIOLATION" => Some(Self::JurisdictionViolation),
            "REASON_CODE_SEMANTIC_THREAT_REVIEW_REQUIRED" => {
                Some(Self::SemanticThreatReviewRequired)
            }
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod policy_decision_point_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct PolicyDecisionPointServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl PolicyDecisionPointServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> PolicyDecisionPointServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> PolicyDecisionPointServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            PolicyDecisionPointServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        pub async fn evaluate(
            &mut self,
            request: impl tonic::IntoRequest<super::PdpRequest>,
        ) -> std::result::Result<tonic::Response<super::PdpResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/helm.kernel.v1.PolicyDecisionPointService/Evaluate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "helm.kernel.v1.PolicyDecisionPointService",
                        "Evaluate",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated client implementations.
pub mod effect_boundary_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct EffectBoundaryServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl EffectBoundaryServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> EffectBoundaryServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> EffectBoundaryServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            EffectBoundaryServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Submit submits an effect for governance evaluation.
        /// Returns a verdict, receipt, and (if ALLOW) an authorized execution intent.
        pub async fn submit(
            &mut self,
            request: impl tonic::IntoRequest<super::EffectRequest>,
        ) -> std::result::Result<tonic::Response<super::EffectResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/helm.kernel.v1.EffectBoundaryService/Submit",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("helm.kernel.v1.EffectBoundaryService", "Submit"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Complete reports the execution result and receives a completion receipt.
        pub async fn complete(
            &mut self,
            request: impl tonic::IntoRequest<super::ExecutionResult>,
        ) -> std::result::Result<
            tonic::Response<super::CompletionReceipt>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/helm.kernel.v1.EffectBoundaryService/Complete",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("helm.kernel.v1.EffectBoundaryService", "Complete"),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}