1#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5#[repr(i32)]
6pub enum PayloadType {
7 RpcReliable = 0,
11 RpcSignal = 1,
13 StreamReliable = 2,
17 StreamLatencyFirst = 3,
19 MediaRtp = 4,
23}
24impl PayloadType {
25 pub fn as_str_name(&self) -> &'static str {
30 match self {
31 Self::RpcReliable => "RPC_RELIABLE",
32 Self::RpcSignal => "RPC_SIGNAL",
33 Self::StreamReliable => "STREAM_RELIABLE",
34 Self::StreamLatencyFirst => "STREAM_LATENCY_FIRST",
35 Self::MediaRtp => "MEDIA_RTP",
36 }
37 }
38 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
40 match value {
41 "RPC_RELIABLE" => Some(Self::RpcReliable),
42 "RPC_SIGNAL" => Some(Self::RpcSignal),
43 "STREAM_RELIABLE" => Some(Self::StreamReliable),
44 "STREAM_LATENCY_FIRST" => Some(Self::StreamLatencyFirst),
45 "MEDIA_RTP" => Some(Self::MediaRtp),
46 _ => None,
47 }
48 }
49}
50#[derive(Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
59#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
60pub struct Realm {
61 #[prost(uint32, required, tag = "1")]
62 pub realm_id: u32,
63}
64#[derive(Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
65#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
66pub struct ActrType {
67 #[prost(string, required, tag = "1")]
68 pub manufacturer: ::prost::alloc::string::String,
69 #[prost(string, required, tag = "2")]
70 pub name: ::prost::alloc::string::String,
71}
72#[derive(Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
73#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
74pub struct ActrId {
75 #[prost(message, required, tag = "1")]
76 pub realm: Realm,
77 #[prost(uint64, required, tag = "2")]
78 pub serial_number: u64,
79 #[prost(message, required, tag = "3")]
80 pub r#type: ActrType,
81}
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct ServiceSpec {
84 #[prost(string, optional, tag = "1")]
85 pub description: ::core::option::Option<::prost::alloc::string::String>,
86 #[prost(string, required, tag = "2")]
88 pub fingerprint: ::prost::alloc::string::String,
89 #[prost(message, repeated, tag = "3")]
90 pub protobufs: ::prost::alloc::vec::Vec<service_spec::Protobuf>,
91 #[prost(int64, optional, tag = "4")]
93 pub published_at: ::core::option::Option<i64>,
94 #[prost(string, repeated, tag = "5")]
96 pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
97}
98pub mod service_spec {
100 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
101 pub struct Protobuf {
102 #[prost(string, required, tag = "1")]
104 pub package: ::prost::alloc::string::String,
105 #[prost(string, required, tag = "2")]
107 pub content: ::prost::alloc::string::String,
108 #[prost(string, required, tag = "3")]
110 pub fingerprint: ::prost::alloc::string::String,
111 }
112}
113#[derive(Clone, PartialEq, ::prost::Message)]
114pub struct ActrNode {
115 #[prost(message, required, tag = "1")]
116 pub actr_id: ActrId,
117 #[prost(message, optional, tag = "2")]
118 pub service_spec: ::core::option::Option<ServiceSpec>,
119}
120#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct ServiceLocation {
123 #[prost(string, optional, tag = "1")]
125 pub region: ::core::option::Option<::prost::alloc::string::String>,
126 #[prost(double, optional, tag = "2")]
128 pub latitude: ::core::option::Option<f64>,
129 #[prost(double, optional, tag = "3")]
131 pub longitude: ::core::option::Option<f64>,
132}
133#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
135pub struct AIdCredential {
136 #[prost(bytes = "bytes", required, tag = "1")]
137 pub encrypted_token: ::prost::bytes::Bytes,
138 #[prost(uint32, required, tag = "2")]
139 pub token_key_id: u32,
140}
141#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct AclRule {
144 #[prost(message, repeated, tag = "1")]
145 pub principals: ::prost::alloc::vec::Vec<acl_rule::Principal>,
146 #[prost(enumeration = "acl_rule::Permission", required, tag = "2")]
147 pub permission: i32,
148}
149pub mod acl_rule {
151 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
152 pub struct Principal {
153 #[prost(message, optional, tag = "1")]
154 pub realm: ::core::option::Option<super::Realm>,
155 #[prost(message, optional, tag = "2")]
156 pub actr_type: ::core::option::Option<super::ActrType>,
157 }
158 #[derive(
159 Clone,
160 Copy,
161 Debug,
162 PartialEq,
163 Eq,
164 Hash,
165 PartialOrd,
166 Ord,
167 ::prost::Enumeration
168 )]
169 #[repr(i32)]
170 pub enum Permission {
171 Deny = 0,
172 Allow = 1,
173 }
174 impl Permission {
175 pub fn as_str_name(&self) -> &'static str {
180 match self {
181 Self::Deny => "DENY",
182 Self::Allow => "ALLOW",
183 }
184 }
185 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
187 match value {
188 "DENY" => Some(Self::Deny),
189 "ALLOW" => Some(Self::Allow),
190 _ => None,
191 }
192 }
193 }
194}
195#[derive(Clone, PartialEq, ::prost::Message)]
197pub struct Acl {
198 #[prost(message, repeated, tag = "1")]
199 pub rules: ::prost::alloc::vec::Vec<AclRule>,
200}
201#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
202pub struct ErrorResponse {
203 #[prost(uint32, required, tag = "1")]
204 pub code: u32,
205 #[prost(string, required, tag = "2")]
206 pub message: ::prost::alloc::string::String,
207}
208#[derive(Clone, PartialEq, ::prost::Message)]
213pub struct RegisterRequest {
214 #[prost(message, required, tag = "1")]
215 pub actr_type: ActrType,
216 #[prost(message, required, tag = "2")]
217 pub realm: Realm,
218 #[prost(message, optional, tag = "3")]
220 pub service_spec: ::core::option::Option<ServiceSpec>,
221 #[prost(message, optional, tag = "4")]
222 pub acl: ::core::option::Option<Acl>,
223}
224#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
225pub struct RegisterResponse {
226 #[prost(oneof = "register_response::Result", tags = "1, 2")]
227 pub result: ::core::option::Option<register_response::Result>,
228}
229pub mod register_response {
231 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
232 pub struct RegisterOk {
233 #[prost(message, required, tag = "1")]
235 pub actr_id: super::ActrId,
236 #[prost(message, required, tag = "2")]
237 pub credential: super::AIdCredential,
238 #[prost(bytes = "bytes", optional, tag = "3")]
240 pub psk: ::core::option::Option<::prost::bytes::Bytes>,
241 #[prost(message, optional, tag = "4")]
242 pub credential_expires_at: ::core::option::Option<::prost_types::Timestamp>,
243 #[prost(uint32, required, tag = "5")]
245 pub signaling_heartbeat_interval_secs: u32,
246 }
247 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
248 pub enum Result {
249 #[prost(message, tag = "1")]
250 Success(RegisterOk),
251 #[prost(message, tag = "2")]
252 Error(super::ErrorResponse),
253 }
254}
255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
256pub struct CredentialUpdateRequest {
257 #[prost(message, required, tag = "1")]
258 pub actr_id: ActrId,
259}
260#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
261pub struct UnregisterRequest {
262 #[prost(message, required, tag = "1")]
263 pub actr_id: ActrId,
264 #[prost(string, optional, tag = "2")]
265 pub reason: ::core::option::Option<::prost::alloc::string::String>,
266}
267#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
268pub struct UnregisterResponse {
269 #[prost(oneof = "unregister_response::Result", tags = "1, 2")]
270 pub result: ::core::option::Option<unregister_response::Result>,
271}
272pub mod unregister_response {
274 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
275 pub struct UnregisterOk {}
276 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
277 pub enum Result {
278 #[prost(message, tag = "1")]
279 Success(UnregisterOk),
280 #[prost(message, tag = "2")]
281 Error(super::ErrorResponse),
282 }
283}
284#[derive(Clone, PartialEq, ::prost::Message)]
294pub struct Ping {
295 #[prost(enumeration = "ServiceAvailabilityState", required, tag = "1")]
296 pub availability: i32,
297 #[prost(float, required, tag = "2")]
298 pub power_reserve: f32,
299 #[prost(float, required, tag = "3")]
300 pub mailbox_backlog: f32,
301 #[prost(string, repeated, tag = "4")]
305 pub sticky_client_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
306}
307#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
308pub struct Pong {
309 #[prost(uint64, required, tag = "1")]
310 pub seq: u64,
311 #[prost(uint32, optional, tag = "2")]
313 pub suggest_interval_secs: ::core::option::Option<u32>,
314}
315#[derive(Clone, PartialEq, ::prost::Message)]
320pub struct RouteCandidatesRequest {
321 #[prost(message, required, tag = "1")]
322 pub target_type: ActrType,
323 #[prost(message, optional, tag = "2")]
324 pub criteria: ::core::option::Option<
325 route_candidates_request::NodeSelectionCriteria,
326 >,
327 #[prost(message, optional, tag = "3")]
329 pub client_location: ::core::option::Option<ServiceLocation>,
330}
331pub mod route_candidates_request {
333 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
334 pub struct NodeSelectionCriteria {
335 #[prost(uint32, required, tag = "1")]
336 pub candidate_count: u32,
337 #[prost(
338 enumeration = "node_selection_criteria::NodeRankingFactor",
339 repeated,
340 packed = "false",
341 tag = "2"
342 )]
343 pub ranking_factors: ::prost::alloc::vec::Vec<i32>,
344 #[prost(enumeration = "super::ServiceDependencyState", optional, tag = "3")]
345 pub minimal_dependency_requirement: ::core::option::Option<i32>,
346 #[prost(enumeration = "super::ServiceAvailabilityState", optional, tag = "4")]
347 pub minimal_health_requirement: ::core::option::Option<i32>,
348 }
349 pub mod node_selection_criteria {
351 #[derive(
353 Clone,
354 Copy,
355 Debug,
356 PartialEq,
357 Eq,
358 Hash,
359 PartialOrd,
360 Ord,
361 ::prost::Enumeration
362 )]
363 #[repr(i32)]
364 pub enum NodeRankingFactor {
365 MaximumPowerReserve = 0,
366 MinimumMailboxBacklog = 1,
367 BestCompatibility = 2,
368 Nearest = 3,
369 ClientAffinity = 4,
370 }
371 impl NodeRankingFactor {
372 pub fn as_str_name(&self) -> &'static str {
377 match self {
378 Self::MaximumPowerReserve => "MAXIMUM_POWER_RESERVE",
379 Self::MinimumMailboxBacklog => "MINIMUM_MAILBOX_BACKLOG",
380 Self::BestCompatibility => "BEST_COMPATIBILITY",
381 Self::Nearest => "NEAREST",
382 Self::ClientAffinity => "CLIENT_AFFINITY",
383 }
384 }
385 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
387 match value {
388 "MAXIMUM_POWER_RESERVE" => Some(Self::MaximumPowerReserve),
389 "MINIMUM_MAILBOX_BACKLOG" => Some(Self::MinimumMailboxBacklog),
390 "BEST_COMPATIBILITY" => Some(Self::BestCompatibility),
391 "NEAREST" => Some(Self::Nearest),
392 "CLIENT_AFFINITY" => Some(Self::ClientAffinity),
393 _ => None,
394 }
395 }
396 }
397 }
398}
399#[derive(Clone, PartialEq, ::prost::Message)]
400pub struct RouteCandidatesResponse {
401 #[prost(oneof = "route_candidates_response::Result", tags = "1, 2")]
402 pub result: ::core::option::Option<route_candidates_response::Result>,
403}
404pub mod route_candidates_response {
406 #[derive(Clone, PartialEq, ::prost::Message)]
407 pub struct RouteCandidatesOk {
408 #[prost(message, repeated, tag = "1")]
409 pub candidates: ::prost::alloc::vec::Vec<super::ActrId>,
410 }
411 #[derive(Clone, PartialEq, ::prost::Oneof)]
412 pub enum Result {
413 #[prost(message, tag = "1")]
414 Success(RouteCandidatesOk),
415 #[prost(message, tag = "2")]
416 Error(super::ErrorResponse),
417 }
418}
419#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
424pub struct DiscoveryRequest {
425 #[prost(string, optional, tag = "1")]
426 pub manufacturer: ::core::option::Option<::prost::alloc::string::String>,
427 #[prost(uint32, optional, tag = "2", default = "64")]
428 pub limit: ::core::option::Option<u32>,
429}
430#[derive(Clone, PartialEq, ::prost::Message)]
431pub struct DiscoveryResponse {
432 #[prost(oneof = "discovery_response::Result", tags = "1, 2")]
433 pub result: ::core::option::Option<discovery_response::Result>,
434}
435pub mod discovery_response {
437 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
438 pub struct TypeEntry {
439 #[prost(message, required, tag = "1")]
440 pub actr_type: super::ActrType,
441 #[prost(string, optional, tag = "2")]
442 pub description: ::core::option::Option<::prost::alloc::string::String>,
443 #[prost(string, required, tag = "3")]
444 pub service_fingerprint: ::prost::alloc::string::String,
445 #[prost(int64, optional, tag = "4")]
446 pub published_at: ::core::option::Option<i64>,
447 #[prost(string, repeated, tag = "5")]
448 pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
449 }
450 #[derive(Clone, PartialEq, ::prost::Message)]
451 pub struct DiscoveryOk {
452 #[prost(message, repeated, tag = "1")]
453 pub entries: ::prost::alloc::vec::Vec<TypeEntry>,
454 }
455 #[derive(Clone, PartialEq, ::prost::Oneof)]
456 pub enum Result {
457 #[prost(message, tag = "1")]
458 Success(DiscoveryOk),
459 #[prost(message, tag = "2")]
460 Error(super::ErrorResponse),
461 }
462}
463#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
465pub struct SubscribeActrUpRequest {
466 #[prost(message, required, tag = "1")]
467 pub target_type: ActrType,
468}
469#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
470pub struct SubscribeActrUpResponse {
471 #[prost(oneof = "subscribe_actr_up_response::Result", tags = "1, 2")]
472 pub result: ::core::option::Option<subscribe_actr_up_response::Result>,
473}
474pub mod subscribe_actr_up_response {
476 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
477 pub struct SubscribeOk {}
478 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
479 pub enum Result {
480 #[prost(message, tag = "1")]
481 Success(SubscribeOk),
482 #[prost(message, tag = "2")]
483 Error(super::ErrorResponse),
484 }
485}
486#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
488pub struct UnsubscribeActrUpRequest {
489 #[prost(message, required, tag = "1")]
490 pub target_type: ActrType,
491}
492#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
493pub struct UnsubscribeActrUpResponse {
494 #[prost(oneof = "unsubscribe_actr_up_response::Result", tags = "1, 2")]
495 pub result: ::core::option::Option<unsubscribe_actr_up_response::Result>,
496}
497pub mod unsubscribe_actr_up_response {
499 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
500 pub struct UnsubscribeOk {}
501 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
502 pub enum Result {
503 #[prost(message, tag = "1")]
504 Success(UnsubscribeOk),
505 #[prost(message, tag = "2")]
506 Error(super::ErrorResponse),
507 }
508}
509#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
511pub struct ActrUpEvent {
512 #[prost(message, required, tag = "1")]
513 pub actor_id: ActrId,
514}
515#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
516#[repr(i32)]
517pub enum LifecycleState {
518 Halted = 0,
519 Initializing = 1,
520 Constructing = 2,
521 Running = 3,
522 Destructing = 4,
523 Crashing = 5,
524}
525impl LifecycleState {
526 pub fn as_str_name(&self) -> &'static str {
531 match self {
532 Self::Halted => "HALTED",
533 Self::Initializing => "INITIALIZING",
534 Self::Constructing => "CONSTRUCTING",
535 Self::Running => "RUNNING",
536 Self::Destructing => "DESTRUCTING",
537 Self::Crashing => "CRASHING",
538 }
539 }
540 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
542 match value {
543 "HALTED" => Some(Self::Halted),
544 "INITIALIZING" => Some(Self::Initializing),
545 "CONSTRUCTING" => Some(Self::Constructing),
546 "RUNNING" => Some(Self::Running),
547 "DESTRUCTING" => Some(Self::Destructing),
548 "CRASHING" => Some(Self::Crashing),
549 _ => None,
550 }
551 }
552}
553#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
554#[repr(i32)]
555pub enum ServiceAvailabilityState {
556 Full = 0,
557 Degraded = 1,
558 Overloaded = 2,
559 Unavailable = 3,
560}
561impl ServiceAvailabilityState {
562 pub fn as_str_name(&self) -> &'static str {
567 match self {
568 Self::Full => "FULL",
569 Self::Degraded => "DEGRADED",
570 Self::Overloaded => "OVERLOADED",
571 Self::Unavailable => "UNAVAILABLE",
572 }
573 }
574 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
576 match value {
577 "FULL" => Some(Self::Full),
578 "DEGRADED" => Some(Self::Degraded),
579 "OVERLOADED" => Some(Self::Overloaded),
580 "UNAVAILABLE" => Some(Self::Unavailable),
581 _ => None,
582 }
583 }
584}
585#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
586#[repr(i32)]
587pub enum ServiceDependencyState {
588 Healthy = 0,
589 Warning = 1,
590 Broken = 2,
591}
592impl ServiceDependencyState {
593 pub fn as_str_name(&self) -> &'static str {
598 match self {
599 Self::Healthy => "HEALTHY",
600 Self::Warning => "WARNING",
601 Self::Broken => "BROKEN",
602 }
603 }
604 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
606 match value {
607 "HEALTHY" => Some(Self::Healthy),
608 "WARNING" => Some(Self::Warning),
609 "BROKEN" => Some(Self::Broken),
610 _ => None,
611 }
612 }
613}
614#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
616pub struct MetadataEntry {
617 #[prost(string, required, tag = "1")]
618 pub key: ::prost::alloc::string::String,
619 #[prost(string, required, tag = "2")]
620 pub value: ::prost::alloc::string::String,
621}
622#[derive(Clone, PartialEq, ::prost::Message)]
624pub struct RpcEnvelope {
625 #[prost(string, required, tag = "1")]
627 pub route_key: ::prost::alloc::string::String,
628 #[prost(bytes = "bytes", optional, tag = "2")]
631 pub payload: ::core::option::Option<::prost::bytes::Bytes>,
632 #[prost(message, optional, tag = "3")]
636 pub error: ::core::option::Option<ErrorResponse>,
637 #[prost(string, required, tag = "100")]
638 pub trace_id: ::prost::alloc::string::String,
639 #[prost(string, required, tag = "101")]
640 pub request_id: ::prost::alloc::string::String,
641 #[prost(message, repeated, tag = "102")]
642 pub metadata: ::prost::alloc::vec::Vec<MetadataEntry>,
643 #[prost(int64, required, tag = "103")]
644 pub timeout_ms: i64,
645}
646#[derive(Clone, PartialEq, ::prost::Message)]
653pub struct DataStream {
654 #[prost(string, required, tag = "1")]
655 pub stream_id: ::prost::alloc::string::String,
656 #[prost(uint64, required, tag = "2")]
657 pub sequence: u64,
658 #[prost(bytes = "bytes", required, tag = "3")]
659 pub payload: ::prost::bytes::Bytes,
660 #[prost(message, repeated, tag = "4")]
661 pub metadata: ::prost::alloc::vec::Vec<MetadataEntry>,
662 #[prost(int64, optional, tag = "5")]
663 pub timestamp_ms: ::core::option::Option<i64>,
664}