1#[derive(serde::Serialize, serde::Deserialize)]
3#[serde(rename_all = "snake_case")]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct GetPolicyRequest {
6 #[prost(message, optional, tag = "1")]
7 pub id: ::core::option::Option<::prost::alloc::string::String>,
8}
9#[derive(serde::Serialize, serde::Deserialize)]
10#[serde(rename_all = "snake_case")]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct ArchiveRetention {
13 #[prost(message, optional, tag = "1")]
14 pub id: ::core::option::Option<::prost::alloc::string::String>,
15}
16#[derive(serde::Serialize, serde::Deserialize)]
17#[serde(rename_all = "snake_case")]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
19#[repr(i32)]
20pub enum Priority {
21 TypeUnspecified = 0,
22 TypeBlock = 1,
23 TypeLow = 2,
24 TypeMedium = 3,
25 TypeHigh = 4,
26}
27impl Priority {
28 pub fn as_str_name(&self) -> &'static str {
33 match self {
34 Self::TypeUnspecified => "PRIORITY_TYPE_UNSPECIFIED",
35 Self::TypeBlock => "PRIORITY_TYPE_BLOCK",
36 Self::TypeLow => "PRIORITY_TYPE_LOW",
37 Self::TypeMedium => "PRIORITY_TYPE_MEDIUM",
38 Self::TypeHigh => "PRIORITY_TYPE_HIGH",
39 }
40 }
41 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
43 match value {
44 "PRIORITY_TYPE_UNSPECIFIED" => Some(Self::TypeUnspecified),
45 "PRIORITY_TYPE_BLOCK" => Some(Self::TypeBlock),
46 "PRIORITY_TYPE_LOW" => Some(Self::TypeLow),
47 "PRIORITY_TYPE_MEDIUM" => Some(Self::TypeMedium),
48 "PRIORITY_TYPE_HIGH" => Some(Self::TypeHigh),
49 _ => None,
50 }
51 }
52}
53#[derive(serde::Serialize, serde::Deserialize)]
54#[serde(rename_all = "snake_case")]
55#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
56#[repr(i32)]
57pub enum Severity {
58 Unspecified = 0,
59 Debug = 1,
60 Verbose = 2,
61 Info = 3,
62 Warning = 4,
63 Error = 5,
64 Critical = 6,
65}
66impl Severity {
67 pub fn as_str_name(&self) -> &'static str {
72 match self {
73 Self::Unspecified => "SEVERITY_UNSPECIFIED",
74 Self::Debug => "SEVERITY_DEBUG",
75 Self::Verbose => "SEVERITY_VERBOSE",
76 Self::Info => "SEVERITY_INFO",
77 Self::Warning => "SEVERITY_WARNING",
78 Self::Error => "SEVERITY_ERROR",
79 Self::Critical => "SEVERITY_CRITICAL",
80 }
81 }
82 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
84 match value {
85 "SEVERITY_UNSPECIFIED" => Some(Self::Unspecified),
86 "SEVERITY_DEBUG" => Some(Self::Debug),
87 "SEVERITY_VERBOSE" => Some(Self::Verbose),
88 "SEVERITY_INFO" => Some(Self::Info),
89 "SEVERITY_WARNING" => Some(Self::Warning),
90 "SEVERITY_ERROR" => Some(Self::Error),
91 "SEVERITY_CRITICAL" => Some(Self::Critical),
92 _ => None,
93 }
94 }
95}
96#[derive(serde::Serialize, serde::Deserialize)]
97#[serde(rename_all = "snake_case")]
98#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
99#[repr(i32)]
100pub enum SourceType {
101 Unspecified = 0,
102 Logs = 1,
103 Spans = 2,
104}
105impl SourceType {
106 pub fn as_str_name(&self) -> &'static str {
111 match self {
112 Self::Unspecified => "SOURCE_TYPE_UNSPECIFIED",
113 Self::Logs => "SOURCE_TYPE_LOGS",
114 Self::Spans => "SOURCE_TYPE_SPANS",
115 }
116 }
117 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
119 match value {
120 "SOURCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
121 "SOURCE_TYPE_LOGS" => Some(Self::Logs),
122 "SOURCE_TYPE_SPANS" => Some(Self::Spans),
123 _ => None,
124 }
125 }
126}
127#[derive(serde::Serialize, serde::Deserialize)]
128#[serde(rename_all = "snake_case")]
129#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
130#[repr(i32)]
131pub enum RuleTypeId {
132 Unspecified = 0,
133 Is = 2,
134 IsNot = 3,
135 StartWith = 4,
136 Includes = 6,
137}
138impl RuleTypeId {
139 pub fn as_str_name(&self) -> &'static str {
144 match self {
145 Self::Unspecified => "RULE_TYPE_ID_UNSPECIFIED",
146 Self::Is => "RULE_TYPE_ID_IS",
147 Self::IsNot => "RULE_TYPE_ID_IS_NOT",
148 Self::StartWith => "RULE_TYPE_ID_START_WITH",
149 Self::Includes => "RULE_TYPE_ID_INCLUDES",
150 }
151 }
152 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
154 match value {
155 "RULE_TYPE_ID_UNSPECIFIED" => Some(Self::Unspecified),
156 "RULE_TYPE_ID_IS" => Some(Self::Is),
157 "RULE_TYPE_ID_IS_NOT" => Some(Self::IsNot),
158 "RULE_TYPE_ID_START_WITH" => Some(Self::StartWith),
159 "RULE_TYPE_ID_INCLUDES" => Some(Self::Includes),
160 _ => None,
161 }
162 }
163}
164#[derive(serde::Serialize, serde::Deserialize)]
165#[serde(rename_all = "snake_case")]
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct Rule {
168 #[prost(enumeration = "RuleTypeId", tag = "1")]
169 pub rule_type_id: i32,
170 #[prost(message, optional, tag = "2")]
171 pub name: ::core::option::Option<::prost::alloc::string::String>,
172}
173#[derive(serde::Serialize, serde::Deserialize)]
174#[serde(rename_all = "snake_case")]
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct LogRules {
177 #[prost(enumeration = "Severity", repeated, tag = "1")]
178 pub severities: ::prost::alloc::vec::Vec<i32>,
179}
180#[derive(serde::Serialize, serde::Deserialize)]
181#[serde(rename_all = "snake_case")]
182#[derive(Clone, PartialEq, ::prost::Message)]
183pub struct TagRule {
184 #[prost(enumeration = "RuleTypeId", tag = "1")]
185 pub rule_type_id: i32,
186 #[prost(message, optional, tag = "2")]
187 pub tag_name: ::core::option::Option<::prost::alloc::string::String>,
188 #[prost(message, optional, tag = "3")]
189 pub tag_value: ::core::option::Option<::prost::alloc::string::String>,
190}
191#[derive(serde::Serialize, serde::Deserialize)]
192#[serde(rename_all = "snake_case")]
193#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct SpanRules {
195 #[prost(message, optional, tag = "1")]
196 pub service_rule: ::core::option::Option<Rule>,
197 #[prost(message, optional, tag = "2")]
198 pub action_rule: ::core::option::Option<Rule>,
199 #[prost(message, repeated, tag = "3")]
200 pub tag_rules: ::prost::alloc::vec::Vec<TagRule>,
201}
202#[derive(serde::Serialize, serde::Deserialize)]
203#[serde(rename_all = "snake_case")]
204#[derive(Clone, PartialEq, ::prost::Message)]
205pub struct Policy {
206 #[prost(message, optional, tag = "1")]
207 pub id: ::core::option::Option<::prost::alloc::string::String>,
208 #[prost(message, optional, tag = "2")]
209 pub company_id: ::core::option::Option<i32>,
210 #[prost(message, optional, tag = "3")]
211 pub name: ::core::option::Option<::prost::alloc::string::String>,
212 #[prost(message, optional, tag = "4")]
213 pub description: ::core::option::Option<::prost::alloc::string::String>,
214 #[prost(enumeration = "Priority", tag = "5")]
215 pub priority: i32,
216 #[prost(message, optional, tag = "6")]
217 pub deleted: ::core::option::Option<bool>,
218 #[prost(message, optional, tag = "7")]
219 pub enabled: ::core::option::Option<bool>,
220 #[prost(message, optional, tag = "8")]
221 pub order: ::core::option::Option<i32>,
222 #[prost(message, optional, tag = "9")]
223 pub application_rule: ::core::option::Option<Rule>,
224 #[prost(message, optional, tag = "10")]
225 pub subsystem_rule: ::core::option::Option<Rule>,
226 #[prost(message, optional, tag = "13")]
227 pub created_at: ::core::option::Option<::prost::alloc::string::String>,
228 #[prost(message, optional, tag = "14")]
229 pub updated_at: ::core::option::Option<::prost::alloc::string::String>,
230 #[prost(message, optional, tag = "15")]
231 pub archive_retention: ::core::option::Option<ArchiveRetention>,
232 #[prost(oneof = "policy::SourceTypeRules", tags = "11, 12")]
233 pub source_type_rules: ::core::option::Option<policy::SourceTypeRules>,
234}
235pub mod policy {
237 #[derive(serde::Serialize, serde::Deserialize)]
238 #[serde(rename_all = "snake_case")]
239 #[derive(Clone, PartialEq, ::prost::Oneof)]
240 pub enum SourceTypeRules {
241 #[prost(message, tag = "11")]
242 LogRules(super::LogRules),
243 #[prost(message, tag = "12")]
244 SpanRules(super::SpanRules),
245 }
246}
247#[derive(serde::Serialize, serde::Deserialize)]
248#[serde(rename_all = "snake_case")]
249#[derive(Clone, PartialEq, ::prost::Message)]
250pub struct GetPolicyResponse {
251 #[prost(message, optional, tag = "1")]
252 pub policy: ::core::option::Option<Policy>,
253}
254#[derive(serde::Serialize, serde::Deserialize)]
255#[serde(rename_all = "snake_case")]
256#[derive(Clone, PartialEq, ::prost::Message)]
257pub struct CreatePolicyRequest {
258 #[prost(message, optional, tag = "1")]
259 pub name: ::core::option::Option<::prost::alloc::string::String>,
260 #[prost(message, optional, tag = "2")]
261 pub description: ::core::option::Option<::prost::alloc::string::String>,
262 #[prost(enumeration = "Priority", tag = "3")]
263 pub priority: i32,
264 #[prost(message, optional, tag = "4")]
265 pub application_rule: ::core::option::Option<Rule>,
266 #[prost(message, optional, tag = "5")]
267 pub subsystem_rule: ::core::option::Option<Rule>,
268 #[prost(message, optional, tag = "6")]
269 pub archive_retention: ::core::option::Option<ArchiveRetention>,
270 #[prost(oneof = "create_policy_request::SourceTypeRules", tags = "7, 8")]
271 pub source_type_rules: ::core::option::Option<
272 create_policy_request::SourceTypeRules,
273 >,
274}
275pub mod create_policy_request {
277 #[derive(serde::Serialize, serde::Deserialize)]
278 #[serde(rename_all = "snake_case")]
279 #[derive(Clone, PartialEq, ::prost::Oneof)]
280 pub enum SourceTypeRules {
281 #[prost(message, tag = "7")]
282 LogRules(super::LogRules),
283 #[prost(message, tag = "8")]
284 SpanRules(super::SpanRules),
285 }
286}
287#[derive(serde::Serialize, serde::Deserialize)]
288#[serde(rename_all = "snake_case")]
289#[derive(Clone, PartialEq, ::prost::Message)]
290pub struct CreatePolicyResponse {
291 #[prost(message, optional, tag = "1")]
292 pub policy: ::core::option::Option<Policy>,
293}
294#[derive(serde::Serialize, serde::Deserialize)]
295#[serde(rename_all = "snake_case")]
296#[derive(Clone, PartialEq, ::prost::Message)]
297pub struct UpdatePolicyRequest {
298 #[prost(message, optional, tag = "1")]
299 pub id: ::core::option::Option<::prost::alloc::string::String>,
300 #[prost(message, optional, tag = "2")]
301 pub name: ::core::option::Option<::prost::alloc::string::String>,
302 #[prost(message, optional, tag = "3")]
303 pub description: ::core::option::Option<::prost::alloc::string::String>,
304 #[prost(enumeration = "Priority", tag = "4")]
305 pub priority: i32,
306 #[prost(message, optional, tag = "5")]
307 pub application_rule: ::core::option::Option<Rule>,
308 #[prost(message, optional, tag = "6")]
309 pub subsystem_rule: ::core::option::Option<Rule>,
310 #[prost(message, optional, tag = "7")]
311 pub archive_retention: ::core::option::Option<ArchiveRetention>,
312 #[prost(message, optional, tag = "10")]
313 pub enabled: ::core::option::Option<bool>,
314 #[prost(oneof = "update_policy_request::SourceTypeRules", tags = "8, 9")]
315 pub source_type_rules: ::core::option::Option<
316 update_policy_request::SourceTypeRules,
317 >,
318}
319pub mod update_policy_request {
321 #[derive(serde::Serialize, serde::Deserialize)]
322 #[serde(rename_all = "snake_case")]
323 #[derive(Clone, PartialEq, ::prost::Oneof)]
324 pub enum SourceTypeRules {
325 #[prost(message, tag = "8")]
326 LogRules(super::LogRules),
327 #[prost(message, tag = "9")]
328 SpanRules(super::SpanRules),
329 }
330}
331#[derive(serde::Serialize, serde::Deserialize)]
332#[serde(rename_all = "snake_case")]
333#[derive(Clone, PartialEq, ::prost::Message)]
334pub struct UpdatePolicyResponse {
335 #[prost(message, optional, tag = "1")]
336 pub policy: ::core::option::Option<Policy>,
337}
338#[derive(serde::Serialize, serde::Deserialize)]
339#[serde(rename_all = "snake_case")]
340#[derive(Clone, Copy, PartialEq, ::prost::Message)]
341pub struct GetCompanyPoliciesRequest {
342 #[prost(message, optional, tag = "1")]
343 pub enabled_only: ::core::option::Option<bool>,
344 #[prost(enumeration = "SourceType", optional, tag = "2")]
345 pub source_type: ::core::option::Option<i32>,
346}
347#[derive(serde::Serialize, serde::Deserialize)]
348#[serde(rename_all = "snake_case")]
349#[derive(Clone, PartialEq, ::prost::Message)]
350pub struct GetCompanyPoliciesResponse {
351 #[prost(message, repeated, tag = "1")]
352 pub policies: ::prost::alloc::vec::Vec<Policy>,
353}
354#[derive(serde::Serialize, serde::Deserialize)]
355#[serde(rename_all = "snake_case")]
356#[derive(Clone, PartialEq, ::prost::Message)]
357pub struct DeletePolicyRequest {
358 #[prost(message, optional, tag = "1")]
359 pub id: ::core::option::Option<::prost::alloc::string::String>,
360}
361#[derive(serde::Serialize, serde::Deserialize)]
362#[serde(rename_all = "snake_case")]
363#[derive(Clone, PartialEq, ::prost::Message)]
364pub struct DeletePolicyResponse {
365 #[prost(message, optional, tag = "1")]
366 pub id: ::core::option::Option<::prost::alloc::string::String>,
367}
368#[derive(serde::Serialize, serde::Deserialize)]
369#[serde(rename_all = "snake_case")]
370#[derive(Clone, PartialEq, ::prost::Message)]
371pub struct PolicyOrder {
372 #[prost(message, optional, tag = "1")]
373 pub order: ::core::option::Option<i32>,
374 #[prost(message, optional, tag = "2")]
375 pub id: ::core::option::Option<::prost::alloc::string::String>,
376}
377#[derive(serde::Serialize, serde::Deserialize)]
378#[serde(rename_all = "snake_case")]
379#[derive(Clone, PartialEq, ::prost::Message)]
380pub struct ReorderPoliciesRequest {
381 #[prost(message, repeated, tag = "1")]
382 pub orders: ::prost::alloc::vec::Vec<PolicyOrder>,
383 #[prost(enumeration = "SourceType", tag = "2")]
384 pub source_type: i32,
385}
386#[derive(serde::Serialize, serde::Deserialize)]
387#[serde(rename_all = "snake_case")]
388#[derive(Clone, PartialEq, ::prost::Message)]
389pub struct ReorderPoliciesResponse {
390 #[prost(message, repeated, tag = "1")]
391 pub orders: ::prost::alloc::vec::Vec<PolicyOrder>,
392}
393#[derive(serde::Serialize, serde::Deserialize)]
394#[serde(rename_all = "snake_case")]
395#[derive(Clone, PartialEq, ::prost::Message)]
396pub struct LogMetaFieldsValues {
397 #[prost(message, optional, tag = "1")]
398 pub application_name_values: ::core::option::Option<::prost::alloc::string::String>,
399 #[prost(message, optional, tag = "2")]
400 pub severity_values: ::core::option::Option<::prost::alloc::string::String>,
401 #[prost(message, optional, tag = "3")]
402 pub subsystem_name_values: ::core::option::Option<::prost::alloc::string::String>,
403}
404#[derive(serde::Serialize, serde::Deserialize)]
405#[serde(rename_all = "snake_case")]
406#[derive(Clone, PartialEq, ::prost::Message)]
407pub struct BulkTestLogPoliciesRequest {
408 #[prost(message, repeated, tag = "1")]
409 pub meta_fields_values_list: ::prost::alloc::vec::Vec<LogMetaFieldsValues>,
410}
411#[derive(serde::Serialize, serde::Deserialize)]
412#[serde(rename_all = "snake_case")]
413#[derive(Clone, PartialEq, ::prost::Message)]
414pub struct TestPoliciesResult {
415 #[prost(message, optional, tag = "1")]
416 pub meta_fields_values: ::core::option::Option<LogMetaFieldsValues>,
417 #[prost(message, optional, tag = "2")]
418 pub matched: ::core::option::Option<bool>,
419 #[prost(message, optional, tag = "3")]
420 pub policy: ::core::option::Option<Policy>,
421}
422#[derive(serde::Serialize, serde::Deserialize)]
423#[serde(rename_all = "snake_case")]
424#[derive(Clone, PartialEq, ::prost::Message)]
425pub struct BulkTestLogPoliciesResponse {
426 #[prost(message, repeated, tag = "1")]
427 pub test_policies_bulk_result: ::prost::alloc::vec::Vec<TestPoliciesResult>,
428}
429#[derive(serde::Serialize, serde::Deserialize)]
430#[serde(rename_all = "snake_case")]
431#[derive(Clone, PartialEq, ::prost::Message)]
432pub struct TogglePolicyRequest {
433 #[prost(message, optional, tag = "1")]
434 pub id: ::core::option::Option<::prost::alloc::string::String>,
435 #[prost(message, optional, tag = "2")]
436 pub enabled: ::core::option::Option<bool>,
437}
438#[derive(serde::Serialize, serde::Deserialize)]
439#[serde(rename_all = "snake_case")]
440#[derive(Clone, PartialEq, ::prost::Message)]
441pub struct TogglePolicyResponse {
442 #[prost(message, optional, tag = "1")]
443 pub id: ::core::option::Option<::prost::alloc::string::String>,
444 #[prost(message, optional, tag = "2")]
445 pub enabled: ::core::option::Option<bool>,
446}
447#[derive(serde::Serialize, serde::Deserialize)]
448#[serde(rename_all = "snake_case")]
449#[derive(Clone, PartialEq, ::prost::Message)]
450pub struct AtomicBatchCreatePolicyRequest {
451 #[prost(message, repeated, tag = "1")]
452 pub policy_requests: ::prost::alloc::vec::Vec<CreatePolicyRequest>,
453}
454#[derive(serde::Serialize, serde::Deserialize)]
455#[serde(rename_all = "snake_case")]
456#[derive(Clone, PartialEq, ::prost::Message)]
457pub struct AtomicBatchCreatePolicyResponse {
458 #[prost(message, repeated, tag = "1")]
459 pub create_responses: ::prost::alloc::vec::Vec<CreatePolicyResponse>,
460}
461#[derive(serde::Serialize, serde::Deserialize)]
462#[serde(rename_all = "snake_case")]
463#[derive(Clone, PartialEq, ::prost::Message)]
464pub struct AtomicOverwriteLogPoliciesResponse {
465 #[prost(message, repeated, tag = "1")]
466 pub create_responses: ::prost::alloc::vec::Vec<CreatePolicyResponse>,
467}
468#[derive(serde::Serialize, serde::Deserialize)]
469#[serde(rename_all = "snake_case")]
470#[derive(Clone, PartialEq, ::prost::Message)]
471pub struct AtomicOverwriteSpanPoliciesResponse {
472 #[prost(message, repeated, tag = "1")]
473 pub create_responses: ::prost::alloc::vec::Vec<CreatePolicyResponse>,
474}
475#[derive(serde::Serialize, serde::Deserialize)]
477#[serde(rename_all = "snake_case")]
478#[derive(Clone, PartialEq, ::prost::Message)]
479pub struct AtomicOverwriteLogPoliciesRequest {
480 #[prost(message, repeated, tag = "1")]
481 pub policies: ::prost::alloc::vec::Vec<CreateLogPolicyRequest>,
482}
483#[derive(serde::Serialize, serde::Deserialize)]
485#[serde(rename_all = "snake_case")]
486#[derive(Clone, PartialEq, ::prost::Message)]
487pub struct AtomicOverwriteSpanPoliciesRequest {
488 #[prost(message, repeated, tag = "1")]
489 pub policies: ::prost::alloc::vec::Vec<CreateSpanPolicyRequest>,
490}
491#[derive(serde::Serialize, serde::Deserialize)]
492#[serde(rename_all = "snake_case")]
493#[derive(Clone, PartialEq, ::prost::Message)]
494pub struct CreateSpanPolicyRequest {
495 #[prost(message, optional, tag = "1")]
496 pub policy: ::core::option::Option<CreateGenericPolicyRequest>,
497 #[prost(message, optional, tag = "2")]
498 pub span_rules: ::core::option::Option<SpanRules>,
499}
500#[derive(serde::Serialize, serde::Deserialize)]
501#[serde(rename_all = "snake_case")]
502#[derive(Clone, PartialEq, ::prost::Message)]
503pub struct CreateLogPolicyRequest {
504 #[prost(message, optional, tag = "1")]
505 pub policy: ::core::option::Option<CreateGenericPolicyRequest>,
506 #[prost(message, optional, tag = "2")]
507 pub log_rules: ::core::option::Option<LogRules>,
508}
509#[derive(serde::Serialize, serde::Deserialize)]
510#[serde(rename_all = "snake_case")]
511#[derive(Clone, PartialEq, ::prost::Message)]
512pub struct CreateGenericPolicyRequest {
513 #[prost(message, optional, tag = "1")]
514 pub name: ::core::option::Option<::prost::alloc::string::String>,
515 #[prost(message, optional, tag = "2")]
516 pub description: ::core::option::Option<::prost::alloc::string::String>,
517 #[prost(enumeration = "Priority", tag = "3")]
518 pub priority: i32,
519 #[prost(message, optional, tag = "4")]
520 pub application_rule: ::core::option::Option<Rule>,
521 #[prost(message, optional, tag = "5")]
522 pub subsystem_rule: ::core::option::Option<Rule>,
523 #[prost(message, optional, tag = "6")]
524 pub archive_retention: ::core::option::Option<ArchiveRetention>,
525}
526pub mod policies_service_client {
528 #![allow(
529 unused_variables,
530 dead_code,
531 missing_docs,
532 clippy::wildcard_imports,
533 clippy::let_unit_value,
534 )]
535 use tonic::codegen::*;
536 use tonic::codegen::http::Uri;
537 #[derive(Debug, Clone)]
538 pub struct PoliciesServiceClient<T> {
539 inner: tonic::client::Grpc<T>,
540 }
541 impl PoliciesServiceClient<tonic::transport::Channel> {
542 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
544 where
545 D: TryInto<tonic::transport::Endpoint>,
546 D::Error: Into<StdError>,
547 {
548 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
549 Ok(Self::new(conn))
550 }
551 }
552 impl<T> PoliciesServiceClient<T>
553 where
554 T: tonic::client::GrpcService<tonic::body::BoxBody>,
555 T::Error: Into<StdError>,
556 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
557 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
558 {
559 pub fn new(inner: T) -> Self {
560 let inner = tonic::client::Grpc::new(inner);
561 Self { inner }
562 }
563 pub fn with_origin(inner: T, origin: Uri) -> Self {
564 let inner = tonic::client::Grpc::with_origin(inner, origin);
565 Self { inner }
566 }
567 pub fn with_interceptor<F>(
568 inner: T,
569 interceptor: F,
570 ) -> PoliciesServiceClient<InterceptedService<T, F>>
571 where
572 F: tonic::service::Interceptor,
573 T::ResponseBody: Default,
574 T: tonic::codegen::Service<
575 http::Request<tonic::body::BoxBody>,
576 Response = http::Response<
577 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
578 >,
579 >,
580 <T as tonic::codegen::Service<
581 http::Request<tonic::body::BoxBody>,
582 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
583 {
584 PoliciesServiceClient::new(InterceptedService::new(inner, interceptor))
585 }
586 #[must_use]
591 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
592 self.inner = self.inner.send_compressed(encoding);
593 self
594 }
595 #[must_use]
597 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
598 self.inner = self.inner.accept_compressed(encoding);
599 self
600 }
601 #[must_use]
605 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
606 self.inner = self.inner.max_decoding_message_size(limit);
607 self
608 }
609 #[must_use]
613 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
614 self.inner = self.inner.max_encoding_message_size(limit);
615 self
616 }
617 pub async fn get_policy(
618 &mut self,
619 request: impl tonic::IntoRequest<super::GetPolicyRequest>,
620 ) -> std::result::Result<
621 tonic::Response<super::GetPolicyResponse>,
622 tonic::Status,
623 > {
624 self.inner
625 .ready()
626 .await
627 .map_err(|e| {
628 tonic::Status::unknown(
629 format!("Service was not ready: {}", e.into()),
630 )
631 })?;
632 let codec = tonic::codec::ProstCodec::default();
633 let path = http::uri::PathAndQuery::from_static(
634 "/com.coralogix.quota.v1.PoliciesService/GetPolicy",
635 );
636 let mut req = request.into_request();
637 req.extensions_mut()
638 .insert(
639 GrpcMethod::new(
640 "com.coralogix.quota.v1.PoliciesService",
641 "GetPolicy",
642 ),
643 );
644 self.inner.unary(req, path, codec).await
645 }
646 pub async fn create_policy(
647 &mut self,
648 request: impl tonic::IntoRequest<super::CreatePolicyRequest>,
649 ) -> std::result::Result<
650 tonic::Response<super::CreatePolicyResponse>,
651 tonic::Status,
652 > {
653 self.inner
654 .ready()
655 .await
656 .map_err(|e| {
657 tonic::Status::unknown(
658 format!("Service was not ready: {}", e.into()),
659 )
660 })?;
661 let codec = tonic::codec::ProstCodec::default();
662 let path = http::uri::PathAndQuery::from_static(
663 "/com.coralogix.quota.v1.PoliciesService/CreatePolicy",
664 );
665 let mut req = request.into_request();
666 req.extensions_mut()
667 .insert(
668 GrpcMethod::new(
669 "com.coralogix.quota.v1.PoliciesService",
670 "CreatePolicy",
671 ),
672 );
673 self.inner.unary(req, path, codec).await
674 }
675 pub async fn update_policy(
676 &mut self,
677 request: impl tonic::IntoRequest<super::UpdatePolicyRequest>,
678 ) -> std::result::Result<
679 tonic::Response<super::UpdatePolicyResponse>,
680 tonic::Status,
681 > {
682 self.inner
683 .ready()
684 .await
685 .map_err(|e| {
686 tonic::Status::unknown(
687 format!("Service was not ready: {}", e.into()),
688 )
689 })?;
690 let codec = tonic::codec::ProstCodec::default();
691 let path = http::uri::PathAndQuery::from_static(
692 "/com.coralogix.quota.v1.PoliciesService/UpdatePolicy",
693 );
694 let mut req = request.into_request();
695 req.extensions_mut()
696 .insert(
697 GrpcMethod::new(
698 "com.coralogix.quota.v1.PoliciesService",
699 "UpdatePolicy",
700 ),
701 );
702 self.inner.unary(req, path, codec).await
703 }
704 pub async fn get_company_policies(
705 &mut self,
706 request: impl tonic::IntoRequest<super::GetCompanyPoliciesRequest>,
707 ) -> std::result::Result<
708 tonic::Response<super::GetCompanyPoliciesResponse>,
709 tonic::Status,
710 > {
711 self.inner
712 .ready()
713 .await
714 .map_err(|e| {
715 tonic::Status::unknown(
716 format!("Service was not ready: {}", e.into()),
717 )
718 })?;
719 let codec = tonic::codec::ProstCodec::default();
720 let path = http::uri::PathAndQuery::from_static(
721 "/com.coralogix.quota.v1.PoliciesService/GetCompanyPolicies",
722 );
723 let mut req = request.into_request();
724 req.extensions_mut()
725 .insert(
726 GrpcMethod::new(
727 "com.coralogix.quota.v1.PoliciesService",
728 "GetCompanyPolicies",
729 ),
730 );
731 self.inner.unary(req, path, codec).await
732 }
733 pub async fn delete_policy(
734 &mut self,
735 request: impl tonic::IntoRequest<super::DeletePolicyRequest>,
736 ) -> std::result::Result<
737 tonic::Response<super::DeletePolicyResponse>,
738 tonic::Status,
739 > {
740 self.inner
741 .ready()
742 .await
743 .map_err(|e| {
744 tonic::Status::unknown(
745 format!("Service was not ready: {}", e.into()),
746 )
747 })?;
748 let codec = tonic::codec::ProstCodec::default();
749 let path = http::uri::PathAndQuery::from_static(
750 "/com.coralogix.quota.v1.PoliciesService/DeletePolicy",
751 );
752 let mut req = request.into_request();
753 req.extensions_mut()
754 .insert(
755 GrpcMethod::new(
756 "com.coralogix.quota.v1.PoliciesService",
757 "DeletePolicy",
758 ),
759 );
760 self.inner.unary(req, path, codec).await
761 }
762 pub async fn reorder_policies(
763 &mut self,
764 request: impl tonic::IntoRequest<super::ReorderPoliciesRequest>,
765 ) -> std::result::Result<
766 tonic::Response<super::ReorderPoliciesResponse>,
767 tonic::Status,
768 > {
769 self.inner
770 .ready()
771 .await
772 .map_err(|e| {
773 tonic::Status::unknown(
774 format!("Service was not ready: {}", e.into()),
775 )
776 })?;
777 let codec = tonic::codec::ProstCodec::default();
778 let path = http::uri::PathAndQuery::from_static(
779 "/com.coralogix.quota.v1.PoliciesService/ReorderPolicies",
780 );
781 let mut req = request.into_request();
782 req.extensions_mut()
783 .insert(
784 GrpcMethod::new(
785 "com.coralogix.quota.v1.PoliciesService",
786 "ReorderPolicies",
787 ),
788 );
789 self.inner.unary(req, path, codec).await
790 }
791 pub async fn bulk_test_log_policies(
792 &mut self,
793 request: impl tonic::IntoRequest<super::BulkTestLogPoliciesRequest>,
794 ) -> std::result::Result<
795 tonic::Response<super::BulkTestLogPoliciesResponse>,
796 tonic::Status,
797 > {
798 self.inner
799 .ready()
800 .await
801 .map_err(|e| {
802 tonic::Status::unknown(
803 format!("Service was not ready: {}", e.into()),
804 )
805 })?;
806 let codec = tonic::codec::ProstCodec::default();
807 let path = http::uri::PathAndQuery::from_static(
808 "/com.coralogix.quota.v1.PoliciesService/BulkTestLogPolicies",
809 );
810 let mut req = request.into_request();
811 req.extensions_mut()
812 .insert(
813 GrpcMethod::new(
814 "com.coralogix.quota.v1.PoliciesService",
815 "BulkTestLogPolicies",
816 ),
817 );
818 self.inner.unary(req, path, codec).await
819 }
820 pub async fn toggle_policy(
821 &mut self,
822 request: impl tonic::IntoRequest<super::TogglePolicyRequest>,
823 ) -> std::result::Result<
824 tonic::Response<super::TogglePolicyResponse>,
825 tonic::Status,
826 > {
827 self.inner
828 .ready()
829 .await
830 .map_err(|e| {
831 tonic::Status::unknown(
832 format!("Service was not ready: {}", e.into()),
833 )
834 })?;
835 let codec = tonic::codec::ProstCodec::default();
836 let path = http::uri::PathAndQuery::from_static(
837 "/com.coralogix.quota.v1.PoliciesService/TogglePolicy",
838 );
839 let mut req = request.into_request();
840 req.extensions_mut()
841 .insert(
842 GrpcMethod::new(
843 "com.coralogix.quota.v1.PoliciesService",
844 "TogglePolicy",
845 ),
846 );
847 self.inner.unary(req, path, codec).await
848 }
849 pub async fn atomic_batch_create_policy(
850 &mut self,
851 request: impl tonic::IntoRequest<super::AtomicBatchCreatePolicyRequest>,
852 ) -> std::result::Result<
853 tonic::Response<super::AtomicBatchCreatePolicyResponse>,
854 tonic::Status,
855 > {
856 self.inner
857 .ready()
858 .await
859 .map_err(|e| {
860 tonic::Status::unknown(
861 format!("Service was not ready: {}", e.into()),
862 )
863 })?;
864 let codec = tonic::codec::ProstCodec::default();
865 let path = http::uri::PathAndQuery::from_static(
866 "/com.coralogix.quota.v1.PoliciesService/AtomicBatchCreatePolicy",
867 );
868 let mut req = request.into_request();
869 req.extensions_mut()
870 .insert(
871 GrpcMethod::new(
872 "com.coralogix.quota.v1.PoliciesService",
873 "AtomicBatchCreatePolicy",
874 ),
875 );
876 self.inner.unary(req, path, codec).await
877 }
878 pub async fn atomic_overwrite_log_policies(
879 &mut self,
880 request: impl tonic::IntoRequest<super::AtomicOverwriteLogPoliciesRequest>,
881 ) -> std::result::Result<
882 tonic::Response<super::AtomicOverwriteLogPoliciesResponse>,
883 tonic::Status,
884 > {
885 self.inner
886 .ready()
887 .await
888 .map_err(|e| {
889 tonic::Status::unknown(
890 format!("Service was not ready: {}", e.into()),
891 )
892 })?;
893 let codec = tonic::codec::ProstCodec::default();
894 let path = http::uri::PathAndQuery::from_static(
895 "/com.coralogix.quota.v1.PoliciesService/AtomicOverwriteLogPolicies",
896 );
897 let mut req = request.into_request();
898 req.extensions_mut()
899 .insert(
900 GrpcMethod::new(
901 "com.coralogix.quota.v1.PoliciesService",
902 "AtomicOverwriteLogPolicies",
903 ),
904 );
905 self.inner.unary(req, path, codec).await
906 }
907 pub async fn atomic_overwrite_span_policies(
908 &mut self,
909 request: impl tonic::IntoRequest<super::AtomicOverwriteSpanPoliciesRequest>,
910 ) -> std::result::Result<
911 tonic::Response<super::AtomicOverwriteSpanPoliciesResponse>,
912 tonic::Status,
913 > {
914 self.inner
915 .ready()
916 .await
917 .map_err(|e| {
918 tonic::Status::unknown(
919 format!("Service was not ready: {}", e.into()),
920 )
921 })?;
922 let codec = tonic::codec::ProstCodec::default();
923 let path = http::uri::PathAndQuery::from_static(
924 "/com.coralogix.quota.v1.PoliciesService/AtomicOverwriteSpanPolicies",
925 );
926 let mut req = request.into_request();
927 req.extensions_mut()
928 .insert(
929 GrpcMethod::new(
930 "com.coralogix.quota.v1.PoliciesService",
931 "AtomicOverwriteSpanPolicies",
932 ),
933 );
934 self.inner.unary(req, path, codec).await
935 }
936 }
937}