Skip to main content

pidgr_proto/pidgr/v1/
pidgr.v1.rs

1// @generated
2// This file is @generated by prost-build.
3// ─── Messages ───────────────────────────────────────────────────────────────
4
5/// A pre-generated access code for early access gating.
6/// Codes are single-use: once redeemed during organization creation, they cannot be reused.
7#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8pub struct AccessCode {
9    /// Unique identifier for the access code.
10    #[prost(string, tag="1")]
11    pub id: ::prost::alloc::string::String,
12    /// The access code value (e.g. "PIDGR-A3BF7K2N").
13    /// Format: PIDGR- followed by 8 alphanumeric characters (excludes 0, O, 1, I for readability).
14    #[prost(string, tag="2")]
15    pub code: ::prost::alloc::string::String,
16    /// Optional human-friendly label for tracking (e.g. "Batch Feb 2026", "Demo for Acme").
17    /// Constraints: Max length 200 characters.
18    #[prost(string, tag="3")]
19    pub label: ::prost::alloc::string::String,
20    /// When the code was generated.
21    #[prost(message, optional, tag="4")]
22    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
23    /// When the code was redeemed. Empty if not yet redeemed.
24    #[prost(message, optional, tag="5")]
25    pub redeemed_at: ::core::option::Option<::prost_types::Timestamp>,
26    /// Email of the user who redeemed the code. Empty if not yet redeemed.
27    #[prost(string, tag="6")]
28    pub redeemed_by: ::prost::alloc::string::String,
29    /// When the code was revoked. Empty if not revoked.
30    #[prost(message, optional, tag="7")]
31    pub revoked_at: ::core::option::Option<::prost_types::Timestamp>,
32}
33/// Request to generate one or more access codes.
34#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
35pub struct GenerateAccessCodesRequest {
36    /// Number of codes to generate. Required, must be between 1 and 100.
37    #[prost(int32, tag="1")]
38    pub count: i32,
39    /// Optional label applied to all generated codes.
40    /// Constraints: Max length 200 characters.
41    #[prost(string, tag="2")]
42    pub label: ::prost::alloc::string::String,
43}
44/// Response containing the newly generated access codes.
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct GenerateAccessCodesResponse {
47    /// The generated access codes.
48    #[prost(message, repeated, tag="1")]
49    pub access_codes: ::prost::alloc::vec::Vec<AccessCode>,
50}
51/// Request to list all access codes.
52#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
53pub struct ListAccessCodesRequest {
54}
55/// Response containing all access codes.
56#[derive(Clone, PartialEq, ::prost::Message)]
57pub struct ListAccessCodesResponse {
58    /// All access codes (active, redeemed, and revoked).
59    #[prost(message, repeated, tag="1")]
60    pub access_codes: ::prost::alloc::vec::Vec<AccessCode>,
61}
62/// Request to revoke an access code.
63#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
64pub struct RevokeAccessCodeRequest {
65    /// ID of the access code to revoke. Required.
66    #[prost(string, tag="1")]
67    pub access_code_id: ::prost::alloc::string::String,
68}
69/// Response after revoking an access code.
70#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
71pub struct RevokeAccessCodeResponse {
72}
73// ─── Messages ───────────────────────────────────────────────────────────────
74
75/// Request to submit a user action on a delivered message.
76#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
77pub struct SubmitActionRequest {
78    /// ID of the delivery the user is acting on.
79    /// Constraints: UUID format (36 characters).
80    #[prost(string, tag="1")]
81    pub delivery_id: ::prost::alloc::string::String,
82    /// ID of the action being performed (matches MessageAction.id).
83    /// Constraints: Max length 100 characters.
84    #[prost(string, tag="2")]
85    pub action_id: ::prost::alloc::string::String,
86    /// Optional action-specific payload (e.g. poll response data). Empty for ACK.
87    /// Constraints: Max size 10000 bytes.
88    #[prost(bytes="vec", tag="3")]
89    pub payload: ::prost::alloc::vec::Vec<u8>,
90}
91/// Response after submitting an action.
92#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
93pub struct SubmitActionResponse {
94    /// Whether the action was successfully recorded and forwarded to the workflow.
95    #[prost(bool, tag="1")]
96    pub success: bool,
97}
98/// A named role within an organization with a set of permissions.
99#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
100pub struct Role {
101    /// Unique identifier for the role.
102    #[prost(string, tag="1")]
103    pub id: ::prost::alloc::string::String,
104    /// URL-safe slug (unique within the organization, e.g. "admin", "manager").
105    #[prost(string, tag="2")]
106    pub slug: ::prost::alloc::string::String,
107    /// Human-readable display name.
108    #[prost(string, tag="3")]
109    pub name: ::prost::alloc::string::String,
110    /// Whether this role was seeded by the system on organization creation.
111    #[prost(bool, tag="4")]
112    pub is_default: bool,
113    /// Permissions granted to users with this role.
114    #[prost(enumeration="Permission", repeated, tag="5")]
115    pub permissions: ::prost::alloc::vec::Vec<i32>,
116    /// Whether this role is system-managed and immutable (e.g. super_admin).
117    #[prost(bool, tag="6")]
118    pub is_system: bool,
119}
120// ─── Pagination ─────────────────────────────────────────────────────────────
121
122/// Cursor-based pagination parameters for list requests.
123#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
124pub struct Pagination {
125    /// Maximum number of items to return per page.
126    #[prost(int32, tag="1")]
127    pub page_size: i32,
128    /// Opaque token from a previous response to fetch the next page.
129    #[prost(string, tag="2")]
130    pub page_token: ::prost::alloc::string::String,
131}
132/// Pagination metadata returned alongside list responses.
133#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
134pub struct PaginationMeta {
135    /// Token to pass in the next request to get the following page. Empty if no more pages.
136    #[prost(string, tag="1")]
137    pub next_page_token: ::prost::alloc::string::String,
138    /// Total number of items matching the query (across all pages).
139    #[prost(int32, tag="2")]
140    pub total_count: i32,
141}
142// ─── Message & Action Model ─────────────────────────────────────────────────
143
144/// An action button attached to a message that a recipient can interact with.
145#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
146pub struct MessageAction {
147    /// Unique identifier for this action within the message.
148    #[prost(string, tag="1")]
149    pub id: ::prost::alloc::string::String,
150    /// The type of action (e.g. ACK).
151    #[prost(enumeration="ActionType", tag="2")]
152    pub r#type: i32,
153    /// Display label shown to the recipient (e.g. "Got it").
154    /// Constraints: Max length 50 characters.
155    #[prost(string, tag="3")]
156    pub label: ::prost::alloc::string::String,
157}
158/// Canonical message type used across rendering, inbox, and delivery.
159/// Represents the fully rendered content delivered to a recipient.
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct Message {
162    /// SHA-256 hash of the rendered content, used as a content-addressable ID.
163    #[prost(string, tag="1")]
164    pub content_id: ::prost::alloc::string::String,
165    /// ID of the campaign this message belongs to.
166    #[prost(string, tag="2")]
167    pub campaign_id: ::prost::alloc::string::String,
168    /// Display name of the sender (e.g. organization or campaign name).
169    /// Constraints: Max length 200 characters.
170    #[prost(string, tag="3")]
171    pub sender_name: ::prost::alloc::string::String,
172    /// Short one-line summary shown in notification banners.
173    /// Constraints: Max length 500 characters.
174    #[prost(string, tag="4")]
175    pub summary: ::prost::alloc::string::String,
176    /// Preview text shown in inbox list views.
177    /// Constraints: Max length 500 characters.
178    #[prost(string, tag="5")]
179    pub preview: ::prost::alloc::string::String,
180    /// Full message body content.
181    /// Constraints: Max length 100000 characters.
182    #[prost(string, tag="6")]
183    pub body: ::prost::alloc::string::String,
184    /// Whether this message requires immediate attention from the recipient.
185    #[prost(bool, tag="7")]
186    pub critical: bool,
187    /// Actions available to the recipient (e.g. acknowledge button).
188    #[prost(message, repeated, tag="8")]
189    pub actions: ::prost::alloc::vec::Vec<MessageAction>,
190    /// Timestamp when the message was created.
191    #[prost(message, optional, tag="9")]
192    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
193    /// User-facing title of the message (resolved from campaign or template).
194    /// Constraints: Max length 200 characters.
195    #[prost(string, tag="10")]
196    pub title: ::prost::alloc::string::String,
197}
198// ─── Workflow Definition Model ──────────────────────────────────────────────
199
200/// A data-driven workflow represented as a directed acyclic graph (DAG) of steps.
201/// Defines the automation logic for a campaign's lifecycle.
202/// Backend MUST validate the graph is a DAG (no cycles) before execution.
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct WorkflowDefinition {
205    /// Ordered list of steps in the workflow DAG.
206    /// Constraints: Max 100 steps. Backend MUST validate the graph is a DAG (no cycles).
207    #[prost(message, repeated, tag="1")]
208    pub steps: ::prost::alloc::vec::Vec<WorkflowStep>,
209}
210/// A single step in a workflow DAG with typed configuration and transitions.
211#[derive(Clone, PartialEq, ::prost::Message)]
212pub struct WorkflowStep {
213    /// Unique identifier for this step within the workflow.
214    #[prost(string, tag="1")]
215    pub id: ::prost::alloc::string::String,
216    /// The type of operation this step performs.
217    #[prost(enumeration="StepType", tag="2")]
218    pub r#type: i32,
219    /// Map of outcome labels to the next step ID (e.g. "completed" -> "step_3").
220    /// Constraints: Max 10 transitions per step.
221    #[prost(map="string, string", tag="7")]
222    pub transitions: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
223    /// Step-specific configuration — exactly one must be set, matching the type.
224    #[prost(oneof="workflow_step::Config", tags="3, 4, 5, 6, 8")]
225    pub config: ::core::option::Option<workflow_step::Config>,
226}
227/// Nested message and enum types in `WorkflowStep`.
228pub mod workflow_step {
229    /// Step-specific configuration — exactly one must be set, matching the type.
230    #[derive(Clone, PartialEq, ::prost::Oneof)]
231    pub enum Config {
232        /// Configuration for SEND_NOTIFICATION steps.
233        #[prost(message, tag="3")]
234        SendNotification(super::SendNotificationConfig),
235        /// Configuration for DEADLINE_CHECK steps.
236        #[prost(message, tag="4")]
237        DeadlineCheck(super::DeadlineCheckConfig),
238        /// Configuration for SEND_REMINDER steps.
239        #[prost(message, tag="5")]
240        SendReminder(super::SendReminderConfig),
241        /// Configuration for CALL_WEBHOOK steps.
242        #[prost(message, tag="6")]
243        CallWebhook(super::CallWebhookConfig),
244        /// Configuration for STEP_TYPE_ESCALATE steps.
245        #[prost(message, tag="8")]
246        EscalateConfig(super::EscalateConfig),
247    }
248}
249/// Configuration for a step that sends the initial push notification.
250#[derive(Clone, PartialEq, ::prost::Message)]
251pub struct SendNotificationConfig {
252    /// Notification delivery type (e.g. "push").
253    /// Constraints: Accepted values: "push". Max length 50 characters.
254    #[prost(string, tag="1")]
255    pub r#type: ::prost::alloc::string::String,
256    /// ID of the template to use for this step's notification.
257    /// Empty falls back to campaign-level template_id.
258    /// Constraints: Max length 36 characters (UUID).
259    #[prost(string, tag="2")]
260    pub template_id: ::prost::alloc::string::String,
261    /// Pinned template version for this step.
262    /// 0 falls back to campaign-level template_version.
263    #[prost(int32, tag="3")]
264    pub template_version: i32,
265    /// Display label for the action button (e.g. "Acknowledge", "Got it").
266    /// Constraints: Max length 50 characters.
267    #[prost(string, tag="4")]
268    pub action_label: ::prost::alloc::string::String,
269    /// Action type for this step's message button.
270    #[prost(enumeration="ActionType", tag="5")]
271    pub action_type: i32,
272    /// Values for custom-sourced template variables specific to this step.
273    /// Constraints: Max 100 entries. Key max length 100 characters, value max length 10000 characters.
274    #[prost(map="string, string", tag="6")]
275    pub custom_variables: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
276}
277/// Configuration for a deadline-based timer step that sleeps for a configured
278/// delay before proceeding. Acknowledgments happen independently at the delivery
279/// level and are evaluated by subsequent steps (e.g. SEND_REMINDER).
280#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
281pub struct DeadlineCheckConfig {
282    /// Duration string for the deadline delay (e.g. "120h", "72h").
283    /// Constraints: Valid range 1m to 8760h (1 year).
284    #[prost(string, tag="1")]
285    pub delay: ::prost::alloc::string::String,
286}
287/// Configuration for a step that sends a one-time reminder to non-responsive recipients.
288#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
289pub struct SendReminderConfig {
290    /// Reminder delivery type (e.g. "push").
291    /// Constraints: Accepted values: "push". Max length 50 characters.
292    #[prost(string, tag="1")]
293    pub r#type: ::prost::alloc::string::String,
294}
295/// Configuration for a step that calls an external webhook.
296#[derive(Clone, PartialEq, ::prost::Message)]
297pub struct CallWebhookConfig {
298    /// Human-readable name for this webhook (for logging/display).
299    /// Constraints: Max length 200 characters.
300    #[prost(string, tag="1")]
301    pub name: ::prost::alloc::string::String,
302    /// URL to POST campaign context to.
303    /// Constraints: Max length 2048 characters.
304    /// Security: HTTPS required in production. Backend MUST reject private,
305    /// loopback, and link-local addresses to prevent SSRF attacks.
306    #[prost(string, tag="2")]
307    pub url: ::prost::alloc::string::String,
308    /// Additional HTTP headers to include in the webhook request.
309    /// Constraints: Max 20 entries. Key max length 200 characters, value max length 2000 characters.
310    #[prost(map="string, string", tag="3")]
311    pub headers: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
312}
313/// A target for escalation — who should be notified when escalation fires.
314#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
315pub struct EscalationTarget {
316    /// Type of target.
317    #[prost(enumeration="EscalationTargetType", tag="1")]
318    pub r#type: i32,
319    /// ID of the target (user_id, group_id, or role_id).
320    /// Empty for MANAGER type (resolved at runtime from recipient's manager_id).
321    #[prost(string, tag="2")]
322    pub target_id: ::prost::alloc::string::String,
323}
324/// Configuration for an escalation step in the workflow DAG.
325#[derive(Clone, PartialEq, ::prost::Message)]
326pub struct EscalateConfig {
327    /// Condition that triggers escalation.
328    #[prost(enumeration="EscalationCondition", tag="1")]
329    pub condition: i32,
330    /// Targets to notify when escalation fires.
331    #[prost(message, repeated, tag="2")]
332    pub targets: ::prost::alloc::vec::Vec<EscalationTarget>,
333    /// Number of times to repeat this escalation before moving to the next step.
334    /// Constraints: Max 5.
335    #[prost(int32, tag="3")]
336    pub repeat_count: i32,
337    /// Minutes between repeat attempts.
338    #[prost(int32, tag="4")]
339    pub repeat_interval_minutes: i32,
340}
341// ─── Status Enums ───────────────────────────────────────────────────────────
342
343/// Lifecycle status of a campaign.
344#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
345#[repr(i32)]
346pub enum CampaignStatus {
347    /// Default value; not a valid status.
348    Unspecified = 0,
349    /// Campaign has been created but not yet started.
350    Created = 1,
351    /// Campaign is actively delivering messages and processing actions.
352    Running = 2,
353    /// All recipients have been processed; campaign is finished.
354    Completed = 3,
355    /// Campaign terminated due to an unrecoverable error.
356    Failed = 4,
357    /// Campaign was manually cancelled before completion.
358    Cancelled = 5,
359}
360impl CampaignStatus {
361    /// String value of the enum field names used in the ProtoBuf definition.
362    ///
363    /// The values are not transformed in any way and thus are considered stable
364    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
365    pub fn as_str_name(&self) -> &'static str {
366        match self {
367            Self::Unspecified => "CAMPAIGN_STATUS_UNSPECIFIED",
368            Self::Created => "CAMPAIGN_STATUS_CREATED",
369            Self::Running => "CAMPAIGN_STATUS_RUNNING",
370            Self::Completed => "CAMPAIGN_STATUS_COMPLETED",
371            Self::Failed => "CAMPAIGN_STATUS_FAILED",
372            Self::Cancelled => "CAMPAIGN_STATUS_CANCELLED",
373        }
374    }
375    /// Creates an enum from field names used in the ProtoBuf definition.
376    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
377        match value {
378            "CAMPAIGN_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
379            "CAMPAIGN_STATUS_CREATED" => Some(Self::Created),
380            "CAMPAIGN_STATUS_RUNNING" => Some(Self::Running),
381            "CAMPAIGN_STATUS_COMPLETED" => Some(Self::Completed),
382            "CAMPAIGN_STATUS_FAILED" => Some(Self::Failed),
383            "CAMPAIGN_STATUS_CANCELLED" => Some(Self::Cancelled),
384            _ => None,
385        }
386    }
387}
388/// Delivery status for a single message sent to a recipient.
389#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
390#[repr(i32)]
391pub enum DeliveryStatus {
392    /// Default value; not a valid status.
393    Unspecified = 0,
394    /// Message is queued but has not been sent yet.
395    Pending = 1,
396    /// Push notification was sent to the delivery provider.
397    Sent = 2,
398    /// Message was confirmed delivered to the device.
399    Delivered = 3,
400    /// Recipient completed the required action (e.g. acknowledged).
401    Acknowledged = 4,
402    /// Recipient did not act before the deadline.
403    Missed = 5,
404    /// Recipient has no registered device; delivery was skipped.
405    NoDevice = 6,
406    /// Delivery failed due to a provider or system error.
407    Failed = 7,
408}
409impl DeliveryStatus {
410    /// String value of the enum field names used in the ProtoBuf definition.
411    ///
412    /// The values are not transformed in any way and thus are considered stable
413    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
414    pub fn as_str_name(&self) -> &'static str {
415        match self {
416            Self::Unspecified => "DELIVERY_STATUS_UNSPECIFIED",
417            Self::Pending => "DELIVERY_STATUS_PENDING",
418            Self::Sent => "DELIVERY_STATUS_SENT",
419            Self::Delivered => "DELIVERY_STATUS_DELIVERED",
420            Self::Acknowledged => "DELIVERY_STATUS_ACKNOWLEDGED",
421            Self::Missed => "DELIVERY_STATUS_MISSED",
422            Self::NoDevice => "DELIVERY_STATUS_NO_DEVICE",
423            Self::Failed => "DELIVERY_STATUS_FAILED",
424        }
425    }
426    /// Creates an enum from field names used in the ProtoBuf definition.
427    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
428        match value {
429            "DELIVERY_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
430            "DELIVERY_STATUS_PENDING" => Some(Self::Pending),
431            "DELIVERY_STATUS_SENT" => Some(Self::Sent),
432            "DELIVERY_STATUS_DELIVERED" => Some(Self::Delivered),
433            "DELIVERY_STATUS_ACKNOWLEDGED" => Some(Self::Acknowledged),
434            "DELIVERY_STATUS_MISSED" => Some(Self::Missed),
435            "DELIVERY_STATUS_NO_DEVICE" => Some(Self::NoDevice),
436            "DELIVERY_STATUS_FAILED" => Some(Self::Failed),
437            _ => None,
438        }
439    }
440}
441/// Mobile platform for device registration.
442#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
443#[repr(i32)]
444pub enum Platform {
445    /// Default value; not a valid platform.
446    Unspecified = 0,
447    /// Apple iOS.
448    Ios = 1,
449    /// Google Android.
450    Android = 2,
451}
452impl Platform {
453    /// String value of the enum field names used in the ProtoBuf definition.
454    ///
455    /// The values are not transformed in any way and thus are considered stable
456    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
457    pub fn as_str_name(&self) -> &'static str {
458        match self {
459            Self::Unspecified => "PLATFORM_UNSPECIFIED",
460            Self::Ios => "PLATFORM_IOS",
461            Self::Android => "PLATFORM_ANDROID",
462        }
463    }
464    /// Creates an enum from field names used in the ProtoBuf definition.
465    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
466        match value {
467            "PLATFORM_UNSPECIFIED" => Some(Self::Unspecified),
468            "PLATFORM_IOS" => Some(Self::Ios),
469            "PLATFORM_ANDROID" => Some(Self::Android),
470            _ => None,
471        }
472    }
473}
474/// Granular permission for authorization checks.
475/// Stored in the database as enum names (e.g. "PERMISSION_ORG_READ").
476/// New values MUST be appended with the next sequential number; existing values
477/// MUST NOT be renumbered or removed (enforced by buf breaking).
478#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
479#[repr(i32)]
480pub enum Permission {
481    /// Default value; not a valid permission.
482    Unspecified = 0,
483    /// View organization settings.
484    OrgRead = 1,
485    /// Modify organization settings.
486    OrgWrite = 2,
487    /// View organization members.
488    MembersRead = 3,
489    /// Invite new users to the organization.
490    MembersInvite = 4,
491    /// Change user roles, deactivate users.
492    MembersManage = 5,
493    /// View campaigns and deliveries.
494    CampaignsRead = 6,
495    /// Create and edit campaigns.
496    CampaignsWrite = 7,
497    /// Start campaign execution.
498    CampaignsStart = 8,
499    /// View templates.
500    TemplatesRead = 9,
501    /// Create and edit templates.
502    TemplatesWrite = 10,
503    /// View inbox messages and deliveries.
504    InboxRead = 11,
505    /// Submit actions on deliveries.
506    InboxAct = 12,
507    /// View all groups in the organization.
508    GroupsAllRead = 13,
509    /// Create, edit, delete groups the caller created, manage own group membership.
510    GroupsWrite = 14,
511    /// Create, edit, delete any group in the organization, manage any group membership.
512    GroupsAllWrite = 15,
513    /// View all teams (organizational units) in the organization.
514    TeamsAllRead = 16,
515    /// Create, edit, delete teams the caller created, manage own team membership.
516    TeamsWrite = 17,
517    /// Create, edit, delete any team in the organization, manage any team membership.
518    TeamsAllWrite = 18,
519    /// View privacy requests (exports, deletions) for the organization.
520    PrivacyRead = 19,
521    /// Schedule deletions, export user data, restrict processing.
522    PrivacyWrite = 20,
523    /// View audit trail events for the organization.
524    AuditRead = 21,
525    /// Review and approve template translations.
526    TemplatesReview = 22,
527}
528impl Permission {
529    /// String value of the enum field names used in the ProtoBuf definition.
530    ///
531    /// The values are not transformed in any way and thus are considered stable
532    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
533    pub fn as_str_name(&self) -> &'static str {
534        match self {
535            Self::Unspecified => "PERMISSION_UNSPECIFIED",
536            Self::OrgRead => "PERMISSION_ORG_READ",
537            Self::OrgWrite => "PERMISSION_ORG_WRITE",
538            Self::MembersRead => "PERMISSION_MEMBERS_READ",
539            Self::MembersInvite => "PERMISSION_MEMBERS_INVITE",
540            Self::MembersManage => "PERMISSION_MEMBERS_MANAGE",
541            Self::CampaignsRead => "PERMISSION_CAMPAIGNS_READ",
542            Self::CampaignsWrite => "PERMISSION_CAMPAIGNS_WRITE",
543            Self::CampaignsStart => "PERMISSION_CAMPAIGNS_START",
544            Self::TemplatesRead => "PERMISSION_TEMPLATES_READ",
545            Self::TemplatesWrite => "PERMISSION_TEMPLATES_WRITE",
546            Self::InboxRead => "PERMISSION_INBOX_READ",
547            Self::InboxAct => "PERMISSION_INBOX_ACT",
548            Self::GroupsAllRead => "PERMISSION_GROUPS_ALL_READ",
549            Self::GroupsWrite => "PERMISSION_GROUPS_WRITE",
550            Self::GroupsAllWrite => "PERMISSION_GROUPS_ALL_WRITE",
551            Self::TeamsAllRead => "PERMISSION_TEAMS_ALL_READ",
552            Self::TeamsWrite => "PERMISSION_TEAMS_WRITE",
553            Self::TeamsAllWrite => "PERMISSION_TEAMS_ALL_WRITE",
554            Self::PrivacyRead => "PERMISSION_PRIVACY_READ",
555            Self::PrivacyWrite => "PERMISSION_PRIVACY_WRITE",
556            Self::AuditRead => "PERMISSION_AUDIT_READ",
557            Self::TemplatesReview => "PERMISSION_TEMPLATES_REVIEW",
558        }
559    }
560    /// Creates an enum from field names used in the ProtoBuf definition.
561    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
562        match value {
563            "PERMISSION_UNSPECIFIED" => Some(Self::Unspecified),
564            "PERMISSION_ORG_READ" => Some(Self::OrgRead),
565            "PERMISSION_ORG_WRITE" => Some(Self::OrgWrite),
566            "PERMISSION_MEMBERS_READ" => Some(Self::MembersRead),
567            "PERMISSION_MEMBERS_INVITE" => Some(Self::MembersInvite),
568            "PERMISSION_MEMBERS_MANAGE" => Some(Self::MembersManage),
569            "PERMISSION_CAMPAIGNS_READ" => Some(Self::CampaignsRead),
570            "PERMISSION_CAMPAIGNS_WRITE" => Some(Self::CampaignsWrite),
571            "PERMISSION_CAMPAIGNS_START" => Some(Self::CampaignsStart),
572            "PERMISSION_TEMPLATES_READ" => Some(Self::TemplatesRead),
573            "PERMISSION_TEMPLATES_WRITE" => Some(Self::TemplatesWrite),
574            "PERMISSION_INBOX_READ" => Some(Self::InboxRead),
575            "PERMISSION_INBOX_ACT" => Some(Self::InboxAct),
576            "PERMISSION_GROUPS_ALL_READ" => Some(Self::GroupsAllRead),
577            "PERMISSION_GROUPS_WRITE" => Some(Self::GroupsWrite),
578            "PERMISSION_GROUPS_ALL_WRITE" => Some(Self::GroupsAllWrite),
579            "PERMISSION_TEAMS_ALL_READ" => Some(Self::TeamsAllRead),
580            "PERMISSION_TEAMS_WRITE" => Some(Self::TeamsWrite),
581            "PERMISSION_TEAMS_ALL_WRITE" => Some(Self::TeamsAllWrite),
582            "PERMISSION_PRIVACY_READ" => Some(Self::PrivacyRead),
583            "PERMISSION_PRIVACY_WRITE" => Some(Self::PrivacyWrite),
584            "PERMISSION_AUDIT_READ" => Some(Self::AuditRead),
585            "PERMISSION_TEMPLATES_REVIEW" => Some(Self::TemplatesReview),
586            _ => None,
587        }
588    }
589}
590/// Type of action a recipient can perform on a message.
591#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
592#[repr(i32)]
593pub enum ActionType {
594    /// Default value; not a valid action type.
595    Unspecified = 0,
596    /// Simple acknowledgment — recipient confirms they received the message.
597    Ack = 1,
598}
599impl ActionType {
600    /// String value of the enum field names used in the ProtoBuf definition.
601    ///
602    /// The values are not transformed in any way and thus are considered stable
603    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
604    pub fn as_str_name(&self) -> &'static str {
605        match self {
606            Self::Unspecified => "ACTION_TYPE_UNSPECIFIED",
607            Self::Ack => "ACTION_TYPE_ACK",
608        }
609    }
610    /// Creates an enum from field names used in the ProtoBuf definition.
611    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
612        match value {
613            "ACTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
614            "ACTION_TYPE_ACK" => Some(Self::Ack),
615            _ => None,
616        }
617    }
618}
619/// Type of step within a workflow definition DAG.
620#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
621#[repr(i32)]
622pub enum StepType {
623    /// Default value; not a valid step type.
624    Unspecified = 0,
625    /// Send the initial push notification to all recipients.
626    SendNotification = 1,
627    /// Sleep for a configurable deadline, then proceed to the next step.
628    DeadlineCheck = 2,
629    /// Send a follow-up reminder to recipients who have not acted.
630    SendReminder = 3,
631    /// Call an external webhook with campaign context.
632    CallWebhook = 4,
633    /// Mark unacknowledged deliveries (SENT/DELIVERED) as MISSED. No config required.
634    MarkMissed = 5,
635    /// Escalate unacknowledged deliveries to configured targets.
636    Escalate = 6,
637}
638impl StepType {
639    /// String value of the enum field names used in the ProtoBuf definition.
640    ///
641    /// The values are not transformed in any way and thus are considered stable
642    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
643    pub fn as_str_name(&self) -> &'static str {
644        match self {
645            Self::Unspecified => "STEP_TYPE_UNSPECIFIED",
646            Self::SendNotification => "STEP_TYPE_SEND_NOTIFICATION",
647            Self::DeadlineCheck => "STEP_TYPE_DEADLINE_CHECK",
648            Self::SendReminder => "STEP_TYPE_SEND_REMINDER",
649            Self::CallWebhook => "STEP_TYPE_CALL_WEBHOOK",
650            Self::MarkMissed => "STEP_TYPE_MARK_MISSED",
651            Self::Escalate => "STEP_TYPE_ESCALATE",
652        }
653    }
654    /// Creates an enum from field names used in the ProtoBuf definition.
655    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
656        match value {
657            "STEP_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
658            "STEP_TYPE_SEND_NOTIFICATION" => Some(Self::SendNotification),
659            "STEP_TYPE_DEADLINE_CHECK" => Some(Self::DeadlineCheck),
660            "STEP_TYPE_SEND_REMINDER" => Some(Self::SendReminder),
661            "STEP_TYPE_CALL_WEBHOOK" => Some(Self::CallWebhook),
662            "STEP_TYPE_MARK_MISSED" => Some(Self::MarkMissed),
663            "STEP_TYPE_ESCALATE" => Some(Self::Escalate),
664            _ => None,
665        }
666    }
667}
668/// Condition that must be met for an escalation to fire.
669#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
670#[repr(i32)]
671pub enum EscalationCondition {
672    Unspecified = 0,
673    /// Escalate if the delivery has not been acknowledged.
674    IfNotAcked = 1,
675    /// Escalate if the campaign is still open (even if some deliveries are acknowledged).
676    IfNotClosed = 2,
677}
678impl EscalationCondition {
679    /// String value of the enum field names used in the ProtoBuf definition.
680    ///
681    /// The values are not transformed in any way and thus are considered stable
682    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
683    pub fn as_str_name(&self) -> &'static str {
684        match self {
685            Self::Unspecified => "ESCALATION_CONDITION_UNSPECIFIED",
686            Self::IfNotAcked => "ESCALATION_CONDITION_IF_NOT_ACKED",
687            Self::IfNotClosed => "ESCALATION_CONDITION_IF_NOT_CLOSED",
688        }
689    }
690    /// Creates an enum from field names used in the ProtoBuf definition.
691    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
692        match value {
693            "ESCALATION_CONDITION_UNSPECIFIED" => Some(Self::Unspecified),
694            "ESCALATION_CONDITION_IF_NOT_ACKED" => Some(Self::IfNotAcked),
695            "ESCALATION_CONDITION_IF_NOT_CLOSED" => Some(Self::IfNotClosed),
696            _ => None,
697        }
698    }
699}
700/// Type of escalation target.
701#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
702#[repr(i32)]
703pub enum EscalationTargetType {
704    Unspecified = 0,
705    /// Escalate to a specific user by ID.
706    User = 1,
707    /// Escalate to all members of a group.
708    Group = 2,
709    /// Escalate to the recipient's direct manager (resolved from manager_id at runtime).
710    Manager = 3,
711    /// Escalate to all users with a specific role in the org.
712    Role = 4,
713}
714impl EscalationTargetType {
715    /// String value of the enum field names used in the ProtoBuf definition.
716    ///
717    /// The values are not transformed in any way and thus are considered stable
718    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
719    pub fn as_str_name(&self) -> &'static str {
720        match self {
721            Self::Unspecified => "ESCALATION_TARGET_TYPE_UNSPECIFIED",
722            Self::User => "ESCALATION_TARGET_TYPE_USER",
723            Self::Group => "ESCALATION_TARGET_TYPE_GROUP",
724            Self::Manager => "ESCALATION_TARGET_TYPE_MANAGER",
725            Self::Role => "ESCALATION_TARGET_TYPE_ROLE",
726        }
727    }
728    /// Creates an enum from field names used in the ProtoBuf definition.
729    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
730        match value {
731            "ESCALATION_TARGET_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
732            "ESCALATION_TARGET_TYPE_USER" => Some(Self::User),
733            "ESCALATION_TARGET_TYPE_GROUP" => Some(Self::Group),
734            "ESCALATION_TARGET_TYPE_MANAGER" => Some(Self::Manager),
735            "ESCALATION_TARGET_TYPE_ROLE" => Some(Self::Role),
736            _ => None,
737        }
738    }
739}
740// ─── Messages ───────────────────────────────────────────────────────────────
741
742/// A scoped API key for programmatic access (MCP agents, service integrations).
743#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
744pub struct ApiKey {
745    /// Unique identifier.
746    #[prost(string, tag="1")]
747    pub id: ::prost::alloc::string::String,
748    /// Human-friendly label (e.g. "MCP Production", "CI Pipeline").
749    #[prost(string, tag="2")]
750    pub name: ::prost::alloc::string::String,
751    /// Displayable prefix of the key (e.g. "pidgr_k_abc12345").
752    /// Used for identification — the full key is only returned on creation.
753    #[prost(string, tag="3")]
754    pub key_prefix: ::prost::alloc::string::String,
755    /// Permissions granted to this key.
756    #[prost(enumeration="Permission", repeated, tag="4")]
757    pub permissions: ::prost::alloc::vec::Vec<i32>,
758    /// When the key was created.
759    #[prost(message, optional, tag="5")]
760    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
761    /// Last time the key was used to authenticate a request. Empty if never used.
762    #[prost(message, optional, tag="6")]
763    pub last_used_at: ::core::option::Option<::prost_types::Timestamp>,
764    /// When the key expires. Empty means no expiration.
765    #[prost(message, optional, tag="7")]
766    pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
767    /// Type of this key (API key or SCIM token).
768    /// Defaults to KEY_TYPE_API_KEY for existing keys.
769    #[prost(enumeration="KeyType", tag="8")]
770    pub key_type: i32,
771}
772/// Request to create a new API key.
773#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
774pub struct CreateApiKeyRequest {
775    /// Human-friendly label. Required, max 200 characters.
776    #[prost(string, tag="1")]
777    pub name: ::prost::alloc::string::String,
778    /// Permissions to grant. Required, at least one.
779    /// PERMISSION_UNSPECIFIED values are rejected.
780    #[prost(enumeration="Permission", repeated, tag="2")]
781    pub permissions: ::prost::alloc::vec::Vec<i32>,
782    /// Optional expiration time. If omitted, the key does not expire.
783    #[prost(message, optional, tag="3")]
784    pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
785    /// Type of key to create. Defaults to KEY_TYPE_API_KEY.
786    /// SCIM tokens use the "pidgr_scim_" prefix instead of "pidgr_k_".
787    #[prost(enumeration="KeyType", tag="4")]
788    pub key_type: i32,
789}
790/// Response after creating an API key.
791/// IMPORTANT: The full key is only returned here — it cannot be retrieved later.
792#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
793pub struct CreateApiKeyResponse {
794    /// The created API key metadata.
795    #[prost(message, optional, tag="1")]
796    pub api_key: ::core::option::Option<ApiKey>,
797    /// The full secret key value (e.g. "pidgr_k_abc12345...").
798    /// Store this securely — it is not retrievable after this response.
799    #[prost(string, tag="2")]
800    pub key: ::prost::alloc::string::String,
801}
802/// Request to list all API keys in the caller's organization.
803#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
804pub struct ListApiKeysRequest {
805    /// Optional filter by key type. Unspecified returns all keys.
806    #[prost(enumeration="KeyType", tag="1")]
807    pub key_type: i32,
808}
809/// Response containing the organization's API keys.
810#[derive(Clone, PartialEq, ::prost::Message)]
811pub struct ListApiKeysResponse {
812    /// All active (non-revoked) API keys. Full key values are not included.
813    #[prost(message, repeated, tag="1")]
814    pub api_keys: ::prost::alloc::vec::Vec<ApiKey>,
815}
816/// Request to revoke an API key.
817#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
818pub struct RevokeApiKeyRequest {
819    /// ID of the API key to revoke. Required.
820    #[prost(string, tag="1")]
821    pub api_key_id: ::prost::alloc::string::String,
822}
823/// Response after revoking an API key.
824#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
825pub struct RevokeApiKeyResponse {
826}
827// ─── Enums ──────────────────────────────────────────────────────────────────
828
829/// Type of API key, distinguishing platform keys from SCIM provisioning tokens.
830#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
831#[repr(i32)]
832pub enum KeyType {
833    Unspecified = 0,
834    ApiKey = 1,
835    ScimToken = 2,
836}
837impl KeyType {
838    /// String value of the enum field names used in the ProtoBuf definition.
839    ///
840    /// The values are not transformed in any way and thus are considered stable
841    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
842    pub fn as_str_name(&self) -> &'static str {
843        match self {
844            Self::Unspecified => "KEY_TYPE_UNSPECIFIED",
845            Self::ApiKey => "KEY_TYPE_API_KEY",
846            Self::ScimToken => "KEY_TYPE_SCIM_TOKEN",
847        }
848    }
849    /// Creates an enum from field names used in the ProtoBuf definition.
850    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
851        match value {
852            "KEY_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
853            "KEY_TYPE_API_KEY" => Some(Self::ApiKey),
854            "KEY_TYPE_SCIM_TOKEN" => Some(Self::ScimToken),
855            _ => None,
856        }
857    }
858}
859// ─── Messages ───────────────────────────────────────────────────────────────
860
861/// Request to export all personal data associated with a user.
862/// Auth: Requires JWT. Callable by the user themselves or an org admin.
863#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
864pub struct ExportUserDataRequest {
865    /// Internal user ID whose data is being exported.
866    /// Constraints: UUID format (36 characters).
867    #[prost(string, tag="1")]
868    pub user_id: ::prost::alloc::string::String,
869}
870/// Response containing the export status and download location.
871#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
872pub struct ExportUserDataResponse {
873    /// Current status of the export request.
874    #[prost(enumeration="PrivacyRequestStatus", tag="1")]
875    pub status: i32,
876    /// Pre-signed S3 URL to download the exported data (ZIP format).
877    /// Only populated when status is COMPLETED.
878    #[prost(string, tag="2")]
879    pub result_url: ::prost::alloc::string::String,
880    /// Unique identifier for this export request.
881    /// Constraints: UUID format (36 characters).
882    #[prost(string, tag="3")]
883    pub export_id: ::prost::alloc::string::String,
884}
885/// Request to delete or anonymize all personal data associated with a user.
886/// Auth: Requires JWT. Admin only.
887#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
888pub struct DeleteUserDataRequest {
889    /// Internal user ID whose data is being deleted.
890    /// Constraints: UUID format (36 characters).
891    #[prost(string, tag="1")]
892    pub user_id: ::prost::alloc::string::String,
893    /// When true, PII is replaced with placeholders instead of hard-deleted.
894    /// This preserves audit trail integrity while removing personal data.
895    #[prost(bool, tag="2")]
896    pub anonymize: bool,
897}
898/// Response confirming the deletion request.
899#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
900pub struct DeleteUserDataResponse {
901    /// Current status of the deletion request.
902    #[prost(enumeration="PrivacyRequestStatus", tag="1")]
903    pub status: i32,
904    /// Timestamp when deletion was completed (or scheduled).
905    /// Only populated when status is COMPLETED.
906    #[prost(message, optional, tag="2")]
907    pub deleted_at: ::core::option::Option<::prost_types::Timestamp>,
908    /// Unique identifier for this deletion request.
909    #[prost(string, tag="3")]
910    pub request_id: ::prost::alloc::string::String,
911}
912/// Request to list privacy requests for the organization.
913/// Auth: Requires JWT. Admin only.
914#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
915pub struct ListPrivacyRequestsRequest {
916    /// Maximum number of results per page.
917    /// Constraints: 1–100, default 25.
918    #[prost(int32, tag="1")]
919    pub page_size: i32,
920    /// Continuation token from a previous response.
921    #[prost(string, tag="2")]
922    pub page_token: ::prost::alloc::string::String,
923    /// Filter by request type (export, delete, rectify, restrict). Empty = all.
924    #[prost(string, tag="3")]
925    pub request_type: ::prost::alloc::string::String,
926    /// Filter by status. UNSPECIFIED = all.
927    #[prost(enumeration="PrivacyRequestStatus", tag="4")]
928    pub status: i32,
929}
930/// Response containing privacy requests.
931#[derive(Clone, PartialEq, ::prost::Message)]
932pub struct ListPrivacyRequestsResponse {
933    /// The privacy requests matching the filters.
934    #[prost(message, repeated, tag="1")]
935    pub requests: ::prost::alloc::vec::Vec<PrivacyRequest>,
936    /// Token for the next page. Empty if no more results.
937    #[prost(string, tag="2")]
938    pub next_page_token: ::prost::alloc::string::String,
939}
940/// A privacy request record.
941#[derive(Clone, PartialEq, ::prost::Message)]
942pub struct PrivacyRequest {
943    /// Unique identifier.
944    #[prost(string, tag="1")]
945    pub id: ::prost::alloc::string::String,
946    /// The user this request applies to.
947    #[prost(string, tag="2")]
948    pub user_id: ::prost::alloc::string::String,
949    /// Email of the target user.
950    #[prost(string, tag="3")]
951    pub user_email: ::prost::alloc::string::String,
952    /// Type of request (export, delete, rectify, restrict).
953    #[prost(string, tag="4")]
954    pub request_type: ::prost::alloc::string::String,
955    /// Current status.
956    #[prost(enumeration="PrivacyRequestStatus", tag="5")]
957    pub status: i32,
958    /// Whether to anonymize (true) or hard-delete (false). Only for delete requests.
959    #[prost(bool, tag="6")]
960    pub anonymize: bool,
961    /// Email of the admin who initiated this request.
962    #[prost(string, tag="7")]
963    pub requested_by_email: ::prost::alloc::string::String,
964    /// When the request was created.
965    #[prost(message, optional, tag="8")]
966    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
967    /// When the request was completed (if applicable).
968    #[prost(message, optional, tag="9")]
969    pub completed_at: ::core::option::Option<::prost_types::Timestamp>,
970    /// Additional metadata (JSON).
971    #[prost(map="string, string", tag="10")]
972    pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
973}
974/// Request to cancel a pending deletion.
975/// Auth: Requires JWT. Admin only.
976#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
977pub struct CancelDeletionRequest {
978    /// The privacy request ID to cancel.
979    #[prost(string, tag="1")]
980    pub request_id: ::prost::alloc::string::String,
981    /// Admin must type the target user's email to confirm.
982    #[prost(string, tag="2")]
983    pub confirmation_email: ::prost::alloc::string::String,
984}
985/// Response confirming the cancellation.
986#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
987pub struct CancelDeletionResponse {
988    /// Updated status (should be FAILED with reason cancelled).
989    #[prost(enumeration="PrivacyRequestStatus", tag="1")]
990    pub status: i32,
991}
992/// Request to skip the grace period and delete immediately.
993/// Auth: Requires JWT. Admin only.
994#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
995pub struct ImmediateDeleteRequest {
996    /// The privacy request ID to expedite.
997    #[prost(string, tag="1")]
998    pub request_id: ::prost::alloc::string::String,
999    /// Admin must type the target user's email to confirm.
1000    #[prost(string, tag="2")]
1001    pub confirmation_email: ::prost::alloc::string::String,
1002}
1003/// Response confirming the immediate deletion was triggered.
1004#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1005pub struct ImmediateDeleteResponse {
1006    /// Updated status (should be PROCESSING).
1007    #[prost(enumeration="PrivacyRequestStatus", tag="1")]
1008    pub status: i32,
1009}
1010/// Request to correct personal data for a user.
1011/// Auth: Requires JWT. Callable by the user themselves or an org admin.
1012#[derive(Clone, PartialEq, ::prost::Message)]
1013pub struct RectifyUserDataRequest {
1014    /// Internal user ID whose data is being corrected.
1015    /// Constraints: UUID format (36 characters).
1016    #[prost(string, tag="1")]
1017    pub user_id: ::prost::alloc::string::String,
1018    /// Map of field names to corrected values.
1019    /// Corrections are propagated to all stored locations.
1020    /// Constraints: Max 50 corrections per request.
1021    #[prost(map="string, string", tag="2")]
1022    pub corrections: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
1023}
1024/// Response listing which fields were successfully corrected.
1025#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1026pub struct RectifyUserDataResponse {
1027    /// Names of fields that were rectified.
1028    #[prost(string, repeated, tag="1")]
1029    pub rectified_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1030}
1031/// Request to restrict or unrestrict processing for a user.
1032/// Auth: Requires JWT. Admin only.
1033#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1034pub struct RestrictProcessingRequest {
1035    /// Internal user ID whose processing is being restricted.
1036    /// Constraints: UUID format (36 characters).
1037    #[prost(string, tag="1")]
1038    pub user_id: ::prost::alloc::string::String,
1039    /// When true, processing is restricted. When false, restriction is lifted.
1040    #[prost(bool, tag="2")]
1041    pub restricted: bool,
1042}
1043/// Response confirming the processing restriction status.
1044#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1045pub struct RestrictProcessingResponse {
1046    /// Current restriction status.
1047    #[prost(bool, tag="1")]
1048    pub restricted: bool,
1049    /// Timestamp when the restriction was applied or removed.
1050    #[prost(message, optional, tag="2")]
1051    pub restricted_at: ::core::option::Option<::prost_types::Timestamp>,
1052}
1053/// Request to confirm whether personal data exists for a user.
1054/// LGPD-specific: confirmação de existência (Art. 18, I).
1055/// Auth: Requires JWT. Admin only.
1056#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1057pub struct GetDataExistenceConfirmationRequest {
1058    /// Internal user ID to check.
1059    /// Constraints: UUID format (36 characters).
1060    #[prost(string, tag="1")]
1061    pub user_id: ::prost::alloc::string::String,
1062}
1063/// Response confirming data existence and listing data categories.
1064#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1065pub struct GetDataExistenceConfirmationResponse {
1066    /// Whether any personal data exists for this user.
1067    #[prost(bool, tag="1")]
1068    pub exists: bool,
1069    /// Categories of data stored (e.g., "profile", "deliveries", "analytics").
1070    #[prost(string, repeated, tag="2")]
1071    pub data_categories: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1072}
1073/// Request to list the calling user's own privacy requests.
1074/// Auth: Requires JWT. No admin permission required — returns only the caller's requests.
1075#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1076pub struct ListMyPrivacyRequestsRequest {
1077    /// Maximum number of results per page.
1078    /// Constraints: 1–100, default 25.
1079    #[prost(int32, tag="1")]
1080    pub page_size: i32,
1081    /// Continuation token from a previous response.
1082    #[prost(string, tag="2")]
1083    pub page_token: ::prost::alloc::string::String,
1084    /// Filter by request type (export, rectify). Empty = all.
1085    #[prost(string, tag="3")]
1086    pub request_type: ::prost::alloc::string::String,
1087    /// Filter by status. UNSPECIFIED = all.
1088    #[prost(enumeration="PrivacyRequestStatus", tag="4")]
1089    pub status: i32,
1090}
1091/// Response containing the calling user's privacy requests.
1092#[derive(Clone, PartialEq, ::prost::Message)]
1093pub struct ListMyPrivacyRequestsResponse {
1094    /// The privacy requests belonging to the calling user.
1095    #[prost(message, repeated, tag="1")]
1096    pub requests: ::prost::alloc::vec::Vec<PrivacyRequest>,
1097    /// Token for the next page. Empty if no more results.
1098    #[prost(string, tag="2")]
1099    pub next_page_token: ::prost::alloc::string::String,
1100}
1101// ─── Enums ──────────────────────────────────────────────────────────────────
1102
1103/// Status of a privacy request (export, delete, rectify, restrict).
1104#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1105#[repr(i32)]
1106pub enum PrivacyRequestStatus {
1107    /// Default value; should not be used explicitly.
1108    Unspecified = 0,
1109    /// Request has been created but not yet started.
1110    Pending = 1,
1111    /// Request is currently being processed.
1112    Processing = 2,
1113    /// Request completed successfully.
1114    Completed = 3,
1115    /// Request failed during processing.
1116    Failed = 4,
1117}
1118impl PrivacyRequestStatus {
1119    /// String value of the enum field names used in the ProtoBuf definition.
1120    ///
1121    /// The values are not transformed in any way and thus are considered stable
1122    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1123    pub fn as_str_name(&self) -> &'static str {
1124        match self {
1125            Self::Unspecified => "PRIVACY_REQUEST_STATUS_UNSPECIFIED",
1126            Self::Pending => "PRIVACY_REQUEST_STATUS_PENDING",
1127            Self::Processing => "PRIVACY_REQUEST_STATUS_PROCESSING",
1128            Self::Completed => "PRIVACY_REQUEST_STATUS_COMPLETED",
1129            Self::Failed => "PRIVACY_REQUEST_STATUS_FAILED",
1130        }
1131    }
1132    /// Creates an enum from field names used in the ProtoBuf definition.
1133    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1134        match value {
1135            "PRIVACY_REQUEST_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
1136            "PRIVACY_REQUEST_STATUS_PENDING" => Some(Self::Pending),
1137            "PRIVACY_REQUEST_STATUS_PROCESSING" => Some(Self::Processing),
1138            "PRIVACY_REQUEST_STATUS_COMPLETED" => Some(Self::Completed),
1139            "PRIVACY_REQUEST_STATUS_FAILED" => Some(Self::Failed),
1140            _ => None,
1141        }
1142    }
1143}
1144// ─── Messages ───────────────────────────────────────────────────────────────
1145
1146/// An immutable audit event capturing a significant platform action.
1147/// Audit events are append-only — they cannot be updated or deleted.
1148#[derive(Clone, PartialEq, ::prost::Message)]
1149pub struct AuditEvent {
1150    /// Unique identifier for this audit event.
1151    /// Constraints: UUID format (36 characters).
1152    #[prost(string, tag="1")]
1153    pub id: ::prost::alloc::string::String,
1154    /// Organization in which the event occurred.
1155    /// Constraints: UUID format (36 characters).
1156    #[prost(string, tag="2")]
1157    pub org_id: ::prost::alloc::string::String,
1158    /// User who performed the action. Empty for system-initiated events.
1159    /// Constraints: UUID format (36 characters) when present.
1160    #[prost(string, tag="3")]
1161    pub actor_id: ::prost::alloc::string::String,
1162    /// Type of action that was performed.
1163    #[prost(enumeration="AuditEventType", tag="4")]
1164    pub event_type: i32,
1165    /// Type of entity affected (e.g., "campaign", "user", "template").
1166    /// Constraints: Max length 50 characters.
1167    #[prost(string, tag="5")]
1168    pub entity_type: ::prost::alloc::string::String,
1169    /// Identifier of the entity affected.
1170    /// Constraints: UUID format (36 characters).
1171    #[prost(string, tag="6")]
1172    pub entity_id: ::prost::alloc::string::String,
1173    /// Additional context about the event (e.g., old/new values for changes).
1174    /// Constraints: Max 20 key-value pairs, keys max 50 chars, values max 500 chars.
1175    #[prost(map="string, string", tag="7")]
1176    pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
1177    /// Timestamp when the event was recorded.
1178    #[prost(message, optional, tag="10")]
1179    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
1180}
1181/// Request to list audit events with optional filters.
1182/// Auth: Requires JWT. Admin only.
1183#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1184pub struct ListAuditEventsRequest {
1185    /// Pagination token from a previous response.
1186    #[prost(string, tag="1")]
1187    pub page_token: ::prost::alloc::string::String,
1188    /// Maximum number of events to return.
1189    /// Constraints: Min 1, max 100. Default 50.
1190    #[prost(int32, tag="2")]
1191    pub page_size: i32,
1192    /// Optional filter: only return events of this type.
1193    #[prost(enumeration="AuditEventType", tag="3")]
1194    pub event_type: i32,
1195    /// Optional filter: only return events by this actor.
1196    /// Constraints: UUID format (36 characters).
1197    #[prost(string, tag="4")]
1198    pub actor_id: ::prost::alloc::string::String,
1199    /// Optional filter: events after this timestamp (inclusive).
1200    #[prost(message, optional, tag="5")]
1201    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
1202    /// Optional filter: events before this timestamp (exclusive).
1203    #[prost(message, optional, tag="6")]
1204    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
1205}
1206/// Response containing a paginated list of audit events.
1207#[derive(Clone, PartialEq, ::prost::Message)]
1208pub struct ListAuditEventsResponse {
1209    /// Audit events matching the request filters.
1210    #[prost(message, repeated, tag="1")]
1211    pub events: ::prost::alloc::vec::Vec<AuditEvent>,
1212    /// Token for fetching the next page. Empty when no more events.
1213    #[prost(string, tag="2")]
1214    pub next_page_token: ::prost::alloc::string::String,
1215}
1216/// Request to export the audit trail to S3 in a specified format.
1217/// Auth: Requires JWT. Admin only.
1218#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1219pub struct ExportAuditTrailRequest {
1220    /// Export format.
1221    #[prost(enumeration="AuditExportFormat", tag="1")]
1222    pub format: i32,
1223    /// Optional: export events after this timestamp.
1224    #[prost(message, optional, tag="2")]
1225    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
1226    /// Optional: export events before this timestamp.
1227    #[prost(message, optional, tag="3")]
1228    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
1229}
1230/// Response containing the export download URL.
1231#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1232pub struct ExportAuditTrailResponse {
1233    /// Pre-signed S3 URL to download the exported audit trail.
1234    /// Only populated when status is COMPLETED.
1235    #[prost(string, tag="1")]
1236    pub export_url: ::prost::alloc::string::String,
1237    /// Current status of the export request.
1238    #[prost(enumeration="PrivacyRequestStatus", tag="2")]
1239    pub status: i32,
1240}
1241/// A persistent record of an audit trail export request.
1242#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1243pub struct AuditExport {
1244    /// Unique identifier.
1245    #[prost(string, tag="1")]
1246    pub id: ::prost::alloc::string::String,
1247    /// Export format (csv, json).
1248    #[prost(string, tag="2")]
1249    pub format: ::prost::alloc::string::String,
1250    /// Current status.
1251    #[prost(enumeration="PrivacyRequestStatus", tag="3")]
1252    pub status: i32,
1253    /// Pre-signed download URL. Only populated when status is COMPLETED.
1254    #[prost(string, tag="4")]
1255    pub result_url: ::prost::alloc::string::String,
1256    /// Error message if the export failed.
1257    #[prost(string, tag="5")]
1258    pub error_message: ::prost::alloc::string::String,
1259    /// Email of the admin who requested the export.
1260    #[prost(string, tag="6")]
1261    pub requested_by_email: ::prost::alloc::string::String,
1262    /// When the export was requested.
1263    #[prost(message, optional, tag="7")]
1264    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
1265    /// When the export completed (if applicable).
1266    #[prost(message, optional, tag="8")]
1267    pub completed_at: ::core::option::Option<::prost_types::Timestamp>,
1268}
1269/// Request to list audit export history.
1270/// Auth: Requires JWT. Admin only.
1271#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1272pub struct ListAuditExportsRequest {
1273}
1274/// Response containing the list of audit exports.
1275#[derive(Clone, PartialEq, ::prost::Message)]
1276pub struct ListAuditExportsResponse {
1277    /// Audit export records, newest first.
1278    #[prost(message, repeated, tag="1")]
1279    pub exports: ::prost::alloc::vec::Vec<AuditExport>,
1280}
1281// ─── Enums ──────────────────────────────────────────────────────────────────
1282
1283/// Type of auditable platform action.
1284#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1285#[repr(i32)]
1286pub enum AuditEventType {
1287    /// Default value; should not be used explicitly.
1288    Unspecified = 0,
1289    /// ── Campaign lifecycle ───────────────────────────────────────────────────
1290    /// A campaign was created.
1291    CampaignCreated = 1,
1292    /// A message was sent to a recipient.
1293    MessageSent = 2,
1294    /// A message was opened by a recipient.
1295    MessageOpened = 3,
1296    /// A recipient acknowledged a campaign.
1297    AckRegistered = 4,
1298    /// An escalation was triggered by the workflow.
1299    EscalationExecuted = 5,
1300    /// A campaign was started.
1301    CampaignStarted = 12,
1302    /// A campaign was cancelled.
1303    CampaignCancelled = 13,
1304    /// A campaign was updated.
1305    CampaignUpdated = 14,
1306    /// ── User lifecycle ───────────────────────────────────────────────────────
1307    /// A user was invited to the organization.
1308    UserInvited = 6,
1309    /// A user was deactivated.
1310    UserDeactivated = 7,
1311    /// A user was reactivated.
1312    UserReactivated = 15,
1313    /// A user's role was changed (assigned to a different role).
1314    RoleChanged = 10,
1315    /// A user's invite was revoked.
1316    InviteRevoked = 16,
1317    /// A user's profile was updated.
1318    ProfileUpdated = 17,
1319    /// A user's settings were updated.
1320    SettingsUpdated = 18,
1321    /// A user enrolled a passkey.
1322    PasskeyEnrolled = 19,
1323    /// ── GDPR / Privacy ──────────────────────────────────────────────────────
1324    /// A data export was requested (GDPR Art. 15).
1325    DataExportRequested = 8,
1326    /// A data deletion was requested (GDPR Art. 17).
1327    DataDeletionRequested = 9,
1328    /// User data was rectified (GDPR Art. 16).
1329    DataRectified = 20,
1330    /// Data processing was restricted (GDPR Art. 18).
1331    ProcessingRestricted = 21,
1332    /// A scheduled deletion was cancelled.
1333    DeletionCancelled = 22,
1334    /// An immediate deletion was executed.
1335    DeletionImmediate = 23,
1336    /// ── Organization / SSO ───────────────────────────────────────────────────
1337    /// An SSO provider was configured.
1338    SsoConfigured = 11,
1339    /// An SSO provider was created.
1340    SsoProviderCreated = 24,
1341    /// An SSO provider was deleted.
1342    SsoProviderDeleted = 25,
1343    /// Organization settings were updated.
1344    OrgUpdated = 26,
1345    /// ── Roles ────────────────────────────────────────────────────────────────
1346    /// A role was created.
1347    RoleCreated = 27,
1348    /// A role's name or permissions were updated.
1349    RoleUpdated = 28,
1350    /// A role was deleted.
1351    RoleDeleted = 29,
1352    /// ── Templates ────────────────────────────────────────────────────────────
1353    /// A template was created.
1354    TemplateCreated = 30,
1355    /// A template was updated.
1356    TemplateUpdated = 31,
1357    /// ── API Keys ─────────────────────────────────────────────────────────────
1358    /// An API key was created.
1359    ApiKeyCreated = 32,
1360    /// An API key was revoked.
1361    ApiKeyRevoked = 33,
1362    /// ── Invite Links ─────────────────────────────────────────────────────────
1363    /// An invite link was created.
1364    InviteLinkCreated = 34,
1365    /// An invite link was revoked.
1366    InviteLinkRevoked = 35,
1367    /// ── Groups ───────────────────────────────────────────────────────────────
1368    /// A group was created.
1369    GroupCreated = 36,
1370    /// A group was updated.
1371    GroupUpdated = 37,
1372    /// A group was deleted.
1373    GroupDeleted = 38,
1374    /// Members were added to a group.
1375    GroupMembersAdded = 39,
1376    /// Members were removed from a group.
1377    GroupMembersRemoved = 40,
1378    /// ── Teams ────────────────────────────────────────────────────────────────
1379    /// A team was created.
1380    TeamCreated = 41,
1381    /// A team was updated.
1382    TeamUpdated = 42,
1383    /// A team was deleted.
1384    TeamDeleted = 43,
1385    /// Members were added to a team.
1386    TeamMembersAdded = 44,
1387    /// Members were removed from a team.
1388    TeamMembersRemoved = 45,
1389    /// ── SCIM Provisioning ───────────────────────────────────────────────────
1390    /// A user was provisioned via SCIM.
1391    ScimUserProvisioned = 46,
1392    /// A user was deprovisioned via SCIM.
1393    ScimUserDeprovisioned = 47,
1394    /// A user was updated via SCIM.
1395    ScimUserUpdated = 48,
1396    /// ── Translations ────────────────────────────────────────────────────────
1397    /// A template translation was created.
1398    TranslationCreated = 49,
1399    /// A template translation was approved.
1400    TranslationApproved = 50,
1401    /// ── Sandbox Orgs ────────────────────────────────────────────────────────
1402    /// A sandbox organization was created.
1403    SandboxCreated = 51,
1404    /// A sandbox organization expired and was deleted.
1405    SandboxExpired = 52,
1406    /// ── AI/Insights ─────────────────────────────────────────────────────────
1407    /// An AI prediction was served and logged (EU AI Act Art. 12).
1408    AiPredictionLogged = 53,
1409}
1410impl AuditEventType {
1411    /// String value of the enum field names used in the ProtoBuf definition.
1412    ///
1413    /// The values are not transformed in any way and thus are considered stable
1414    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1415    pub fn as_str_name(&self) -> &'static str {
1416        match self {
1417            Self::Unspecified => "AUDIT_EVENT_TYPE_UNSPECIFIED",
1418            Self::CampaignCreated => "AUDIT_EVENT_TYPE_CAMPAIGN_CREATED",
1419            Self::MessageSent => "AUDIT_EVENT_TYPE_MESSAGE_SENT",
1420            Self::MessageOpened => "AUDIT_EVENT_TYPE_MESSAGE_OPENED",
1421            Self::AckRegistered => "AUDIT_EVENT_TYPE_ACK_REGISTERED",
1422            Self::EscalationExecuted => "AUDIT_EVENT_TYPE_ESCALATION_EXECUTED",
1423            Self::CampaignStarted => "AUDIT_EVENT_TYPE_CAMPAIGN_STARTED",
1424            Self::CampaignCancelled => "AUDIT_EVENT_TYPE_CAMPAIGN_CANCELLED",
1425            Self::CampaignUpdated => "AUDIT_EVENT_TYPE_CAMPAIGN_UPDATED",
1426            Self::UserInvited => "AUDIT_EVENT_TYPE_USER_INVITED",
1427            Self::UserDeactivated => "AUDIT_EVENT_TYPE_USER_DEACTIVATED",
1428            Self::UserReactivated => "AUDIT_EVENT_TYPE_USER_REACTIVATED",
1429            Self::RoleChanged => "AUDIT_EVENT_TYPE_ROLE_CHANGED",
1430            Self::InviteRevoked => "AUDIT_EVENT_TYPE_INVITE_REVOKED",
1431            Self::ProfileUpdated => "AUDIT_EVENT_TYPE_PROFILE_UPDATED",
1432            Self::SettingsUpdated => "AUDIT_EVENT_TYPE_SETTINGS_UPDATED",
1433            Self::PasskeyEnrolled => "AUDIT_EVENT_TYPE_PASSKEY_ENROLLED",
1434            Self::DataExportRequested => "AUDIT_EVENT_TYPE_DATA_EXPORT_REQUESTED",
1435            Self::DataDeletionRequested => "AUDIT_EVENT_TYPE_DATA_DELETION_REQUESTED",
1436            Self::DataRectified => "AUDIT_EVENT_TYPE_DATA_RECTIFIED",
1437            Self::ProcessingRestricted => "AUDIT_EVENT_TYPE_PROCESSING_RESTRICTED",
1438            Self::DeletionCancelled => "AUDIT_EVENT_TYPE_DELETION_CANCELLED",
1439            Self::DeletionImmediate => "AUDIT_EVENT_TYPE_DELETION_IMMEDIATE",
1440            Self::SsoConfigured => "AUDIT_EVENT_TYPE_SSO_CONFIGURED",
1441            Self::SsoProviderCreated => "AUDIT_EVENT_TYPE_SSO_PROVIDER_CREATED",
1442            Self::SsoProviderDeleted => "AUDIT_EVENT_TYPE_SSO_PROVIDER_DELETED",
1443            Self::OrgUpdated => "AUDIT_EVENT_TYPE_ORG_UPDATED",
1444            Self::RoleCreated => "AUDIT_EVENT_TYPE_ROLE_CREATED",
1445            Self::RoleUpdated => "AUDIT_EVENT_TYPE_ROLE_UPDATED",
1446            Self::RoleDeleted => "AUDIT_EVENT_TYPE_ROLE_DELETED",
1447            Self::TemplateCreated => "AUDIT_EVENT_TYPE_TEMPLATE_CREATED",
1448            Self::TemplateUpdated => "AUDIT_EVENT_TYPE_TEMPLATE_UPDATED",
1449            Self::ApiKeyCreated => "AUDIT_EVENT_TYPE_API_KEY_CREATED",
1450            Self::ApiKeyRevoked => "AUDIT_EVENT_TYPE_API_KEY_REVOKED",
1451            Self::InviteLinkCreated => "AUDIT_EVENT_TYPE_INVITE_LINK_CREATED",
1452            Self::InviteLinkRevoked => "AUDIT_EVENT_TYPE_INVITE_LINK_REVOKED",
1453            Self::GroupCreated => "AUDIT_EVENT_TYPE_GROUP_CREATED",
1454            Self::GroupUpdated => "AUDIT_EVENT_TYPE_GROUP_UPDATED",
1455            Self::GroupDeleted => "AUDIT_EVENT_TYPE_GROUP_DELETED",
1456            Self::GroupMembersAdded => "AUDIT_EVENT_TYPE_GROUP_MEMBERS_ADDED",
1457            Self::GroupMembersRemoved => "AUDIT_EVENT_TYPE_GROUP_MEMBERS_REMOVED",
1458            Self::TeamCreated => "AUDIT_EVENT_TYPE_TEAM_CREATED",
1459            Self::TeamUpdated => "AUDIT_EVENT_TYPE_TEAM_UPDATED",
1460            Self::TeamDeleted => "AUDIT_EVENT_TYPE_TEAM_DELETED",
1461            Self::TeamMembersAdded => "AUDIT_EVENT_TYPE_TEAM_MEMBERS_ADDED",
1462            Self::TeamMembersRemoved => "AUDIT_EVENT_TYPE_TEAM_MEMBERS_REMOVED",
1463            Self::ScimUserProvisioned => "AUDIT_EVENT_TYPE_SCIM_USER_PROVISIONED",
1464            Self::ScimUserDeprovisioned => "AUDIT_EVENT_TYPE_SCIM_USER_DEPROVISIONED",
1465            Self::ScimUserUpdated => "AUDIT_EVENT_TYPE_SCIM_USER_UPDATED",
1466            Self::TranslationCreated => "AUDIT_EVENT_TYPE_TRANSLATION_CREATED",
1467            Self::TranslationApproved => "AUDIT_EVENT_TYPE_TRANSLATION_APPROVED",
1468            Self::SandboxCreated => "AUDIT_EVENT_TYPE_SANDBOX_CREATED",
1469            Self::SandboxExpired => "AUDIT_EVENT_TYPE_SANDBOX_EXPIRED",
1470            Self::AiPredictionLogged => "AUDIT_EVENT_TYPE_AI_PREDICTION_LOGGED",
1471        }
1472    }
1473    /// Creates an enum from field names used in the ProtoBuf definition.
1474    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1475        match value {
1476            "AUDIT_EVENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1477            "AUDIT_EVENT_TYPE_CAMPAIGN_CREATED" => Some(Self::CampaignCreated),
1478            "AUDIT_EVENT_TYPE_MESSAGE_SENT" => Some(Self::MessageSent),
1479            "AUDIT_EVENT_TYPE_MESSAGE_OPENED" => Some(Self::MessageOpened),
1480            "AUDIT_EVENT_TYPE_ACK_REGISTERED" => Some(Self::AckRegistered),
1481            "AUDIT_EVENT_TYPE_ESCALATION_EXECUTED" => Some(Self::EscalationExecuted),
1482            "AUDIT_EVENT_TYPE_CAMPAIGN_STARTED" => Some(Self::CampaignStarted),
1483            "AUDIT_EVENT_TYPE_CAMPAIGN_CANCELLED" => Some(Self::CampaignCancelled),
1484            "AUDIT_EVENT_TYPE_CAMPAIGN_UPDATED" => Some(Self::CampaignUpdated),
1485            "AUDIT_EVENT_TYPE_USER_INVITED" => Some(Self::UserInvited),
1486            "AUDIT_EVENT_TYPE_USER_DEACTIVATED" => Some(Self::UserDeactivated),
1487            "AUDIT_EVENT_TYPE_USER_REACTIVATED" => Some(Self::UserReactivated),
1488            "AUDIT_EVENT_TYPE_ROLE_CHANGED" => Some(Self::RoleChanged),
1489            "AUDIT_EVENT_TYPE_INVITE_REVOKED" => Some(Self::InviteRevoked),
1490            "AUDIT_EVENT_TYPE_PROFILE_UPDATED" => Some(Self::ProfileUpdated),
1491            "AUDIT_EVENT_TYPE_SETTINGS_UPDATED" => Some(Self::SettingsUpdated),
1492            "AUDIT_EVENT_TYPE_PASSKEY_ENROLLED" => Some(Self::PasskeyEnrolled),
1493            "AUDIT_EVENT_TYPE_DATA_EXPORT_REQUESTED" => Some(Self::DataExportRequested),
1494            "AUDIT_EVENT_TYPE_DATA_DELETION_REQUESTED" => Some(Self::DataDeletionRequested),
1495            "AUDIT_EVENT_TYPE_DATA_RECTIFIED" => Some(Self::DataRectified),
1496            "AUDIT_EVENT_TYPE_PROCESSING_RESTRICTED" => Some(Self::ProcessingRestricted),
1497            "AUDIT_EVENT_TYPE_DELETION_CANCELLED" => Some(Self::DeletionCancelled),
1498            "AUDIT_EVENT_TYPE_DELETION_IMMEDIATE" => Some(Self::DeletionImmediate),
1499            "AUDIT_EVENT_TYPE_SSO_CONFIGURED" => Some(Self::SsoConfigured),
1500            "AUDIT_EVENT_TYPE_SSO_PROVIDER_CREATED" => Some(Self::SsoProviderCreated),
1501            "AUDIT_EVENT_TYPE_SSO_PROVIDER_DELETED" => Some(Self::SsoProviderDeleted),
1502            "AUDIT_EVENT_TYPE_ORG_UPDATED" => Some(Self::OrgUpdated),
1503            "AUDIT_EVENT_TYPE_ROLE_CREATED" => Some(Self::RoleCreated),
1504            "AUDIT_EVENT_TYPE_ROLE_UPDATED" => Some(Self::RoleUpdated),
1505            "AUDIT_EVENT_TYPE_ROLE_DELETED" => Some(Self::RoleDeleted),
1506            "AUDIT_EVENT_TYPE_TEMPLATE_CREATED" => Some(Self::TemplateCreated),
1507            "AUDIT_EVENT_TYPE_TEMPLATE_UPDATED" => Some(Self::TemplateUpdated),
1508            "AUDIT_EVENT_TYPE_API_KEY_CREATED" => Some(Self::ApiKeyCreated),
1509            "AUDIT_EVENT_TYPE_API_KEY_REVOKED" => Some(Self::ApiKeyRevoked),
1510            "AUDIT_EVENT_TYPE_INVITE_LINK_CREATED" => Some(Self::InviteLinkCreated),
1511            "AUDIT_EVENT_TYPE_INVITE_LINK_REVOKED" => Some(Self::InviteLinkRevoked),
1512            "AUDIT_EVENT_TYPE_GROUP_CREATED" => Some(Self::GroupCreated),
1513            "AUDIT_EVENT_TYPE_GROUP_UPDATED" => Some(Self::GroupUpdated),
1514            "AUDIT_EVENT_TYPE_GROUP_DELETED" => Some(Self::GroupDeleted),
1515            "AUDIT_EVENT_TYPE_GROUP_MEMBERS_ADDED" => Some(Self::GroupMembersAdded),
1516            "AUDIT_EVENT_TYPE_GROUP_MEMBERS_REMOVED" => Some(Self::GroupMembersRemoved),
1517            "AUDIT_EVENT_TYPE_TEAM_CREATED" => Some(Self::TeamCreated),
1518            "AUDIT_EVENT_TYPE_TEAM_UPDATED" => Some(Self::TeamUpdated),
1519            "AUDIT_EVENT_TYPE_TEAM_DELETED" => Some(Self::TeamDeleted),
1520            "AUDIT_EVENT_TYPE_TEAM_MEMBERS_ADDED" => Some(Self::TeamMembersAdded),
1521            "AUDIT_EVENT_TYPE_TEAM_MEMBERS_REMOVED" => Some(Self::TeamMembersRemoved),
1522            "AUDIT_EVENT_TYPE_SCIM_USER_PROVISIONED" => Some(Self::ScimUserProvisioned),
1523            "AUDIT_EVENT_TYPE_SCIM_USER_DEPROVISIONED" => Some(Self::ScimUserDeprovisioned),
1524            "AUDIT_EVENT_TYPE_SCIM_USER_UPDATED" => Some(Self::ScimUserUpdated),
1525            "AUDIT_EVENT_TYPE_TRANSLATION_CREATED" => Some(Self::TranslationCreated),
1526            "AUDIT_EVENT_TYPE_TRANSLATION_APPROVED" => Some(Self::TranslationApproved),
1527            "AUDIT_EVENT_TYPE_SANDBOX_CREATED" => Some(Self::SandboxCreated),
1528            "AUDIT_EVENT_TYPE_SANDBOX_EXPIRED" => Some(Self::SandboxExpired),
1529            "AUDIT_EVENT_TYPE_AI_PREDICTION_LOGGED" => Some(Self::AiPredictionLogged),
1530            _ => None,
1531        }
1532    }
1533}
1534/// Format for audit trail export.
1535#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1536#[repr(i32)]
1537pub enum AuditExportFormat {
1538    /// Default value; should not be used explicitly.
1539    Unspecified = 0,
1540    /// Comma-separated values.
1541    Csv = 1,
1542    /// JSON lines format.
1543    Json = 2,
1544    /// Apache Parquet columnar format.
1545    Parquet = 3,
1546}
1547impl AuditExportFormat {
1548    /// String value of the enum field names used in the ProtoBuf definition.
1549    ///
1550    /// The values are not transformed in any way and thus are considered stable
1551    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1552    pub fn as_str_name(&self) -> &'static str {
1553        match self {
1554            Self::Unspecified => "AUDIT_EXPORT_FORMAT_UNSPECIFIED",
1555            Self::Csv => "AUDIT_EXPORT_FORMAT_CSV",
1556            Self::Json => "AUDIT_EXPORT_FORMAT_JSON",
1557            Self::Parquet => "AUDIT_EXPORT_FORMAT_PARQUET",
1558        }
1559    }
1560    /// Creates an enum from field names used in the ProtoBuf definition.
1561    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1562        match value {
1563            "AUDIT_EXPORT_FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
1564            "AUDIT_EXPORT_FORMAT_CSV" => Some(Self::Csv),
1565            "AUDIT_EXPORT_FORMAT_JSON" => Some(Self::Json),
1566            "AUDIT_EXPORT_FORMAT_PARQUET" => Some(Self::Parquet),
1567            _ => None,
1568        }
1569    }
1570}
1571// ─── Messages ───────────────────────────────────────────────────────────────
1572
1573/// A campaign that delivers structured messages to a set of recipients
1574/// and tracks their engagement through a workflow.
1575#[derive(Clone, PartialEq, ::prost::Message)]
1576pub struct Campaign {
1577    /// Unique identifier for the campaign.
1578    /// Constraints: UUID format (36 characters).
1579    #[prost(string, tag="1")]
1580    pub id: ::prost::alloc::string::String,
1581    /// Human-readable campaign name.
1582    /// Constraints: Max length 200 characters.
1583    #[prost(string, tag="2")]
1584    pub name: ::prost::alloc::string::String,
1585    /// ID of the template used to render messages.
1586    /// Constraints: UUID format (36 characters).
1587    #[prost(string, tag="3")]
1588    pub template_id: ::prost::alloc::string::String,
1589    /// Pinned version of the template used for this campaign.
1590    #[prost(int32, tag="4")]
1591    pub template_version: i32,
1592    /// Object storage reference to the audience snapshot taken at campaign creation.
1593    #[prost(string, tag="5")]
1594    pub audience_snapshot_ref: ::prost::alloc::string::String,
1595    /// Current lifecycle status of the campaign.
1596    #[prost(enumeration="CampaignStatus", tag="6")]
1597    pub status: i32,
1598    /// Workflow DAG that drives the campaign's automation logic.
1599    #[prost(message, optional, tag="7")]
1600    pub workflow: ::core::option::Option<WorkflowDefinition>,
1601    /// Total number of recipients in the audience snapshot.
1602    #[prost(int32, tag="8")]
1603    pub total_recipients: i32,
1604    /// Number of recipients who completed the required action.
1605    #[prost(int32, tag="9")]
1606    pub action_completed_count: i32,
1607    /// Number of recipients who did not act before the deadline.
1608    #[prost(int32, tag="10")]
1609    pub missed_count: i32,
1610    /// Timestamp when the campaign was created.
1611    #[prost(message, optional, tag="11")]
1612    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
1613    /// Timestamp when the campaign was started (workflow execution began).
1614    #[prost(message, optional, tag="12")]
1615    pub started_at: ::core::option::Option<::prost_types::Timestamp>,
1616    /// Timestamp when the campaign finished (completed, failed, or cancelled).
1617    #[prost(message, optional, tag="13")]
1618    pub completed_at: ::core::option::Option<::prost_types::Timestamp>,
1619    /// Display name of the sender shown to recipients (e.g. "HR Team").
1620    /// Constraints: Max length 200 characters.
1621    #[prost(string, tag="14")]
1622    pub sender_name: ::prost::alloc::string::String,
1623    /// Optional user-facing title override. If set, takes precedence over the template title.
1624    /// Constraints: Max length 200 characters.
1625    #[prost(string, tag="15")]
1626    pub title: ::prost::alloc::string::String,
1627    /// Whether this campaign's notifications break through Do Not Disturb / Focus mode.
1628    #[prost(bool, tag="16")]
1629    pub critical: bool,
1630    /// Optional locale override for all recipients in this campaign.
1631    /// When set, all recipients receive the campaign in this locale regardless of
1632    /// their preferred_locale. Empty means per-recipient locale resolution.
1633    /// Valid values: en, es, pt-BR, zh, ja.
1634    #[prost(string, tag="17")]
1635    pub default_locale: ::prost::alloc::string::String,
1636    /// Whether the campaign deadline waits for users without registered devices.
1637    /// When true, NO_DEVICE users remain in pending_count and can acknowledge
1638    /// via inbox after installing the app. Default false preserves current behavior.
1639    #[prost(bool, tag="18")]
1640    pub wait_for_enrollment: bool,
1641}
1642/// A single audience member with optional per-user template variables.
1643#[derive(Clone, PartialEq, ::prost::Message)]
1644pub struct AudienceMember {
1645    /// User ID (UUID).
1646    #[prost(string, tag="1")]
1647    pub user_id: ::prost::alloc::string::String,
1648    /// Template variable values for this user (e.g. {"name": "Alice"}).
1649    #[prost(map="string, string", tag="2")]
1650    pub variables: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
1651}
1652/// Request to create a new campaign.
1653#[derive(Clone, PartialEq, ::prost::Message)]
1654pub struct CreateCampaignRequest {
1655    /// Human-readable campaign name (admin-facing label).
1656    /// Constraints: Max length 200 characters.
1657    #[prost(string, tag="1")]
1658    pub name: ::prost::alloc::string::String,
1659    /// ID of the template to use for rendering messages.
1660    /// Constraints: UUID format (36 characters).
1661    #[prost(string, tag="2")]
1662    pub template_id: ::prost::alloc::string::String,
1663    /// Version of the template to pin for this campaign.
1664    #[prost(int32, tag="3")]
1665    pub template_version: i32,
1666    /// List of user IDs that form the campaign audience.
1667    /// Constraints: Max 100000 items.
1668    #[prost(string, repeated, tag="4")]
1669    pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1670    /// Workflow DAG defining the campaign's automation steps.
1671    #[prost(message, optional, tag="5")]
1672    pub workflow: ::core::option::Option<WorkflowDefinition>,
1673    /// Display name of the sender shown to recipients (e.g. "HR Team").
1674    /// Constraints: Max length 200 characters.
1675    #[prost(string, tag="6")]
1676    pub sender_name: ::prost::alloc::string::String,
1677    /// Optional user-facing title override. If empty, the template title is used.
1678    /// Constraints: Max length 200 characters.
1679    #[prost(string, tag="7")]
1680    pub title: ::prost::alloc::string::String,
1681    /// Rich audience with per-user template variables.
1682    /// When set, takes precedence over user_ids.
1683    /// Constraints: Max 100000 items.
1684    #[prost(message, repeated, tag="8")]
1685    pub audience: ::prost::alloc::vec::Vec<AudienceMember>,
1686    /// Whether to include users with processing_restricted=true in the audience.
1687    /// Default false: restricted users are excluded. Set true only with Art. 18(2) legal basis.
1688    #[prost(bool, tag="9")]
1689    pub include_restricted: bool,
1690    /// Whether this campaign's notifications break through Do Not Disturb / Focus mode.
1691    #[prost(bool, tag="10")]
1692    pub critical: bool,
1693    /// Optional locale override for all recipients.
1694    #[prost(string, tag="11")]
1695    pub default_locale: ::prost::alloc::string::String,
1696    /// Whether the campaign deadline should wait for users without registered devices.
1697    /// When true, NO_DEVICE users are not decremented from pending_count,
1698    /// allowing them to acknowledge via inbox after installing the app.
1699    #[prost(bool, tag="12")]
1700    pub wait_for_enrollment: bool,
1701}
1702/// Response after creating a campaign.
1703#[derive(Clone, PartialEq, ::prost::Message)]
1704pub struct CreateCampaignResponse {
1705    /// The newly created campaign.
1706    #[prost(message, optional, tag="1")]
1707    pub campaign: ::core::option::Option<Campaign>,
1708}
1709/// Request to start a campaign's workflow execution.
1710#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1711pub struct StartCampaignRequest {
1712    /// ID of the campaign to start.
1713    /// Constraints: UUID format (36 characters).
1714    #[prost(string, tag="1")]
1715    pub campaign_id: ::prost::alloc::string::String,
1716}
1717/// Response after starting a campaign.
1718#[derive(Clone, PartialEq, ::prost::Message)]
1719pub struct StartCampaignResponse {
1720    /// The campaign with updated status.
1721    #[prost(message, optional, tag="1")]
1722    pub campaign: ::core::option::Option<Campaign>,
1723}
1724/// Request to retrieve a single campaign by ID.
1725#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1726pub struct GetCampaignRequest {
1727    /// ID of the campaign to retrieve.
1728    /// Constraints: UUID format (36 characters).
1729    #[prost(string, tag="1")]
1730    pub campaign_id: ::prost::alloc::string::String,
1731}
1732/// Response containing the requested campaign.
1733#[derive(Clone, PartialEq, ::prost::Message)]
1734pub struct GetCampaignResponse {
1735    /// The requested campaign.
1736    #[prost(message, optional, tag="1")]
1737    pub campaign: ::core::option::Option<Campaign>,
1738}
1739/// Request to list campaigns with pagination.
1740#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1741pub struct ListCampaignsRequest {
1742    /// Pagination parameters.
1743    #[prost(message, optional, tag="1")]
1744    pub pagination: ::core::option::Option<Pagination>,
1745}
1746/// Response containing a page of campaigns.
1747#[derive(Clone, PartialEq, ::prost::Message)]
1748pub struct ListCampaignsResponse {
1749    /// List of campaigns in this page.
1750    #[prost(message, repeated, tag="1")]
1751    pub campaigns: ::prost::alloc::vec::Vec<Campaign>,
1752    /// Pagination metadata for fetching subsequent pages.
1753    #[prost(message, optional, tag="2")]
1754    pub pagination_meta: ::core::option::Option<PaginationMeta>,
1755}
1756/// Request to cancel a running campaign.
1757#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1758pub struct CancelCampaignRequest {
1759    /// ID of the campaign to cancel.
1760    /// Constraints: UUID format (36 characters).
1761    #[prost(string, tag="1")]
1762    pub campaign_id: ::prost::alloc::string::String,
1763}
1764/// Response after cancelling a campaign.
1765#[derive(Clone, PartialEq, ::prost::Message)]
1766pub struct CancelCampaignResponse {
1767    /// The campaign with updated status (CANCELLED).
1768    #[prost(message, optional, tag="1")]
1769    pub campaign: ::core::option::Option<Campaign>,
1770}
1771/// Request to update a draft campaign (status must be CREATED).
1772/// Only non-empty/non-zero fields are updated; omitted fields remain unchanged.
1773#[derive(Clone, PartialEq, ::prost::Message)]
1774pub struct UpdateCampaignRequest {
1775    /// ID of the campaign to update.
1776    /// Constraints: UUID format (36 characters).
1777    #[prost(string, tag="1")]
1778    pub campaign_id: ::prost::alloc::string::String,
1779    /// Updated campaign name. Empty string means no change.
1780    /// Constraints: Max length 200 characters.
1781    #[prost(string, tag="2")]
1782    pub name: ::prost::alloc::string::String,
1783    /// Updated sender display name. Empty string means no change.
1784    /// Constraints: Max length 200 characters.
1785    #[prost(string, tag="3")]
1786    pub sender_name: ::prost::alloc::string::String,
1787    /// Updated title override. Empty string means no change.
1788    /// Constraints: Max length 200 characters.
1789    #[prost(string, tag="4")]
1790    pub title: ::prost::alloc::string::String,
1791    /// Updated template ID. Empty string means no change.
1792    /// Constraints: UUID format (36 characters).
1793    #[prost(string, tag="5")]
1794    pub template_id: ::prost::alloc::string::String,
1795    /// Updated template version. Zero means no change.
1796    #[prost(int32, tag="6")]
1797    pub template_version: i32,
1798    /// Updated workflow DAG. Null/omitted means no change.
1799    #[prost(message, optional, tag="7")]
1800    pub workflow: ::core::option::Option<WorkflowDefinition>,
1801}
1802/// Response after updating a campaign.
1803#[derive(Clone, PartialEq, ::prost::Message)]
1804pub struct UpdateCampaignResponse {
1805    /// The campaign with updated fields.
1806    #[prost(message, optional, tag="1")]
1807    pub campaign: ::core::option::Option<Campaign>,
1808}
1809/// A single delivery record tracking message delivery to one recipient.
1810#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1811pub struct Delivery {
1812    /// Unique identifier for this delivery.
1813    /// Constraints: UUID format (36 characters).
1814    #[prost(string, tag="1")]
1815    pub id: ::prost::alloc::string::String,
1816    /// ID of the recipient user.
1817    /// Constraints: UUID format (36 characters).
1818    #[prost(string, tag="2")]
1819    pub user_id: ::prost::alloc::string::String,
1820    /// ID of the campaign this delivery belongs to.
1821    /// Constraints: UUID format (36 characters).
1822    #[prost(string, tag="3")]
1823    pub campaign_id: ::prost::alloc::string::String,
1824    /// Current delivery status.
1825    #[prost(enumeration="DeliveryStatus", tag="4")]
1826    pub status: i32,
1827    /// Timestamp when the message was delivered to the device.
1828    #[prost(message, optional, tag="5")]
1829    pub delivered_at: ::core::option::Option<::prost_types::Timestamp>,
1830    /// Timestamp when the recipient read the message.
1831    #[prost(message, optional, tag="6")]
1832    pub read_at: ::core::option::Option<::prost_types::Timestamp>,
1833    /// Timestamp when the recipient performed the required action.
1834    #[prost(message, optional, tag="7")]
1835    pub acted_at: ::core::option::Option<::prost_types::Timestamp>,
1836    /// Email address of the recipient, populated from the users table on read.
1837    #[prost(string, tag="8")]
1838    pub recipient_email: ::prost::alloc::string::String,
1839}
1840/// Request to list deliveries for a campaign with optional status filtering.
1841#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1842pub struct ListDeliveriesRequest {
1843    /// ID of the campaign to list deliveries for.
1844    /// Constraints: UUID format (36 characters).
1845    #[prost(string, tag="1")]
1846    pub campaign_id: ::prost::alloc::string::String,
1847    /// Optional filter by delivery status. UNSPECIFIED returns all.
1848    #[prost(enumeration="DeliveryStatus", tag="2")]
1849    pub status_filter: i32,
1850    /// Pagination parameters.
1851    #[prost(message, optional, tag="3")]
1852    pub pagination: ::core::option::Option<Pagination>,
1853}
1854/// Response containing a page of delivery records.
1855#[derive(Clone, PartialEq, ::prost::Message)]
1856pub struct ListDeliveriesResponse {
1857    /// List of deliveries in this page.
1858    #[prost(message, repeated, tag="1")]
1859    pub deliveries: ::prost::alloc::vec::Vec<Delivery>,
1860    /// Pagination metadata for fetching subsequent pages.
1861    #[prost(message, optional, tag="2")]
1862    pub pagination_meta: ::core::option::Option<PaginationMeta>,
1863}
1864// ─── Messages ───────────────────────────────────────────────────────────────
1865
1866/// A registered device that can receive push notifications.
1867/// INTERNAL: This message is for server-side use only. Use DeviceSummary for API responses.
1868#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1869pub struct Device {
1870    /// Unique identifier for this device.
1871    /// Constraints: UUID format (36 characters).
1872    #[prost(string, tag="1")]
1873    pub device_id: ::prost::alloc::string::String,
1874    /// ID of the user who owns this device.
1875    /// Constraints: UUID format (36 characters).
1876    #[prost(string, tag="2")]
1877    pub user_id: ::prost::alloc::string::String,
1878    /// Mobile platform (iOS or Android).
1879    #[prost(enumeration="Platform", tag="3")]
1880    pub platform: i32,
1881    /// Push token used to send notifications to this device.
1882    #[prost(string, tag="4")]
1883    pub push_token: ::prost::alloc::string::String,
1884    /// Whether the device is currently active and eligible for push delivery.
1885    #[prost(bool, tag="5")]
1886    pub active: bool,
1887    /// Timestamp of the last activity from this device.
1888    #[prost(message, optional, tag="6")]
1889    pub last_seen: ::core::option::Option<::prost_types::Timestamp>,
1890    /// Timestamp when the device was first registered.
1891    #[prost(message, optional, tag="7")]
1892    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
1893}
1894/// A device summary safe for API responses — excludes sensitive push_token.
1895#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1896pub struct DeviceSummary {
1897    /// Unique identifier for this device.
1898    #[prost(string, tag="1")]
1899    pub device_id: ::prost::alloc::string::String,
1900    /// ID of the user who owns this device.
1901    #[prost(string, tag="2")]
1902    pub user_id: ::prost::alloc::string::String,
1903    /// Mobile platform (iOS or Android).
1904    #[prost(enumeration="Platform", tag="3")]
1905    pub platform: i32,
1906    /// Whether the device is currently active and eligible for push delivery.
1907    #[prost(bool, tag="4")]
1908    pub active: bool,
1909    /// Timestamp of the last activity from this device.
1910    #[prost(message, optional, tag="5")]
1911    pub last_seen: ::core::option::Option<::prost_types::Timestamp>,
1912    /// Timestamp when the device was first registered.
1913    #[prost(message, optional, tag="6")]
1914    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
1915}
1916/// Request to register a device for push notifications.
1917#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1918pub struct RegisterRequest {
1919    /// Client-generated unique device identifier.
1920    /// Constraints: UUID format (36 characters).
1921    #[prost(string, tag="1")]
1922    pub device_id: ::prost::alloc::string::String,
1923    /// Mobile platform of the device.
1924    #[prost(enumeration="Platform", tag="2")]
1925    pub platform: i32,
1926    /// Push token obtained from the push notification provider on the client.
1927    /// Constraints: Max length 4096 characters.
1928    #[prost(string, tag="3")]
1929    pub push_token: ::prost::alloc::string::String,
1930}
1931/// Response after registering a device.
1932#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1933pub struct RegisterResponse {
1934    /// The registered device summary (excludes push_token).
1935    #[prost(message, optional, tag="1")]
1936    pub device: ::core::option::Option<DeviceSummary>,
1937}
1938/// Request to deactivate a device, stopping push notifications.
1939#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1940pub struct DeactivateRequest {
1941    /// ID of the device to deactivate.
1942    /// Constraints: UUID format (36 characters).
1943    #[prost(string, tag="1")]
1944    pub device_id: ::prost::alloc::string::String,
1945}
1946/// Response after deactivating a device.
1947#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1948pub struct DeactivateResponse {
1949    /// Whether the device was successfully deactivated.
1950    #[prost(bool, tag="1")]
1951    pub success: bool,
1952}
1953/// Request to list all devices for the authenticated user.
1954#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1955pub struct ListDevicesRequest {
1956}
1957/// Response containing all devices for the user.
1958#[derive(Clone, PartialEq, ::prost::Message)]
1959pub struct ListDevicesResponse {
1960    /// List of devices registered to the authenticated user.
1961    #[prost(message, repeated, tag="1")]
1962    pub devices: ::prost::alloc::vec::Vec<DeviceSummary>,
1963}
1964/// Request to list devices for a specific member (admin use).
1965#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1966pub struct ListMemberDevicesRequest {
1967    /// ID of the user whose devices to list.
1968    /// Constraints: UUID format (36 characters).
1969    #[prost(string, tag="1")]
1970    pub user_id: ::prost::alloc::string::String,
1971}
1972/// Response containing all devices for the specified member.
1973#[derive(Clone, PartialEq, ::prost::Message)]
1974pub struct ListMemberDevicesResponse {
1975    /// List of devices registered to the specified user.
1976    #[prost(message, repeated, tag="1")]
1977    pub devices: ::prost::alloc::vec::Vec<DeviceSummary>,
1978}
1979// ─── Messages ───────────────────────────────────────────────────────────────
1980
1981/// User-configurable platform settings that apply across all clients.
1982/// All fields use their UNSPECIFIED/zero value to mean "no change" in updates.
1983#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1984pub struct UserSettings {
1985    /// Preferred color scheme for the UI.
1986    #[prost(enumeration="ThemePreference", tag="1")]
1987    pub theme_preference: i32,
1988    /// User's preferred language for the UI and push notifications.
1989    /// Empty string means "use organization default" or "auto-detect".
1990    /// Valid values: en, es, pt-BR, zh, ja.
1991    #[prost(string, tag="2")]
1992    pub preferred_locale: ::prost::alloc::string::String,
1993}
1994/// Structured profile attributes for a user within an organization.
1995/// Populated through admin invitation, mobile onboarding, or SSO attribute sync.
1996#[derive(Clone, PartialEq, ::prost::Message)]
1997pub struct UserProfile {
1998    /// User's given name.
1999    /// Constraints: Max length 200 characters.
2000    #[prost(string, tag="1")]
2001    pub first_name: ::prost::alloc::string::String,
2002    /// User's family name.
2003    /// Constraints: Max length 200 characters.
2004    #[prost(string, tag="2")]
2005    pub last_name: ::prost::alloc::string::String,
2006    /// Department or team within the organization.
2007    /// Constraints: Max length 200 characters.
2008    #[prost(string, tag="3")]
2009    pub department: ::prost::alloc::string::String,
2010    /// Job title.
2011    /// Constraints: Max length 200 characters.
2012    #[prost(string, tag="4")]
2013    pub title: ::prost::alloc::string::String,
2014    /// Phone number.
2015    /// Constraints: Max length 200 characters.
2016    #[prost(string, tag="5")]
2017    pub phone: ::prost::alloc::string::String,
2018    /// Office or geographic location.
2019    /// Constraints: Max length 200 characters.
2020    #[prost(string, tag="6")]
2021    pub location: ::prost::alloc::string::String,
2022    /// Organization-specific employee identifier.
2023    /// Constraints: Max length 200 characters.
2024    #[prost(string, tag="7")]
2025    pub employee_id: ::prost::alloc::string::String,
2026    /// Display name of the user's direct manager.
2027    /// Constraints: Max length 200 characters.
2028    #[prost(string, tag="8")]
2029    pub manager_name: ::prost::alloc::string::String,
2030    /// Employment start date in ISO 8601 format (YYYY-MM-DD).
2031    /// Constraints: Max length 200 characters.
2032    #[prost(string, tag="9")]
2033    pub start_date: ::prost::alloc::string::String,
2034    /// Organization-defined custom attributes for fields not covered by the fixed schema.
2035    /// Constraints: Max 50 entries. Key max length 100 characters, value max length 1000 characters.
2036    #[prost(map="string, string", tag="10")]
2037    pub custom_attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
2038    /// UUID of the user's direct manager within the same organization.
2039    /// Populated from SCIM enterprise extension (manager.value), manual admin
2040    /// assignment, or SSO attribute mapping. Empty if not set.
2041    #[prost(string, tag="11")]
2042    pub manager_id: ::prost::alloc::string::String,
2043}
2044/// A user within an organization.
2045#[derive(Clone, PartialEq, ::prost::Message)]
2046pub struct User {
2047    /// Unique identifier for the user (internal platform UUID, not identity provider subject ID).
2048    #[prost(string, tag="1")]
2049    pub id: ::prost::alloc::string::String,
2050    /// User's email address.
2051    /// Constraints: Max length 254 characters (RFC 5321).
2052    #[prost(string, tag="2")]
2053    pub email: ::prost::alloc::string::String,
2054    /// User's display name.
2055    /// Constraints: Max length 200 characters.
2056    #[prost(string, tag="3")]
2057    pub name: ::prost::alloc::string::String,
2058    /// Current account status.
2059    #[prost(enumeration="UserStatus", tag="5")]
2060    pub status: i32,
2061    /// Timestamp when the user was created.
2062    #[prost(message, optional, tag="6")]
2063    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
2064    /// The user's role with its permission set.
2065    #[prost(message, optional, tag="7")]
2066    pub role: ::core::option::Option<Role>,
2067    /// ID of the user's role (for assignment operations).
2068    #[prost(string, tag="8")]
2069    pub role_id: ::prost::alloc::string::String,
2070    /// Structured profile attributes (department, title, etc.).
2071    /// May be empty if the user has not completed their profile.
2072    #[prost(message, optional, tag="9")]
2073    pub profile: ::core::option::Option<UserProfile>,
2074    /// Whether data processing is restricted for this user (GDPR Art. 18).
2075    /// When true, the user is excluded from campaign audiences by default.
2076    #[prost(bool, tag="10")]
2077    pub processing_restricted: bool,
2078    /// Data governance region override. Empty string means "inherit from org default".
2079    /// Valid values: EU, LATAM, BR, APAC, US.
2080    #[prost(string, tag="11")]
2081    pub data_governance_region: ::prost::alloc::string::String,
2082}
2083// ─── Enums ──────────────────────────────────────────────────────────────────
2084
2085/// Lifecycle status of a user account.
2086#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2087#[repr(i32)]
2088pub enum UserStatus {
2089    /// Default value; not a valid status.
2090    Unspecified = 0,
2091    /// User has been invited but has not completed onboarding.
2092    Invited = 1,
2093    /// User is active and can receive messages.
2094    Active = 2,
2095    /// User has been deactivated and will not receive messages.
2096    Deactivated = 3,
2097}
2098impl UserStatus {
2099    /// String value of the enum field names used in the ProtoBuf definition.
2100    ///
2101    /// The values are not transformed in any way and thus are considered stable
2102    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2103    pub fn as_str_name(&self) -> &'static str {
2104        match self {
2105            Self::Unspecified => "USER_STATUS_UNSPECIFIED",
2106            Self::Invited => "USER_STATUS_INVITED",
2107            Self::Active => "USER_STATUS_ACTIVE",
2108            Self::Deactivated => "USER_STATUS_DEACTIVATED",
2109        }
2110    }
2111    /// Creates an enum from field names used in the ProtoBuf definition.
2112    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2113        match value {
2114            "USER_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
2115            "USER_STATUS_INVITED" => Some(Self::Invited),
2116            "USER_STATUS_ACTIVE" => Some(Self::Active),
2117            "USER_STATUS_DEACTIVATED" => Some(Self::Deactivated),
2118            _ => None,
2119        }
2120    }
2121}
2122/// User's preferred color scheme.
2123#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2124#[repr(i32)]
2125pub enum ThemePreference {
2126    /// Default value; treated as SYSTEM when reading, "no change" when updating.
2127    Unspecified = 0,
2128    /// Always use light mode regardless of system setting.
2129    Light = 1,
2130    /// Always use dark mode regardless of system setting.
2131    Dark = 2,
2132    /// Follow the operating system or browser preference.
2133    System = 3,
2134}
2135impl ThemePreference {
2136    /// String value of the enum field names used in the ProtoBuf definition.
2137    ///
2138    /// The values are not transformed in any way and thus are considered stable
2139    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2140    pub fn as_str_name(&self) -> &'static str {
2141        match self {
2142            Self::Unspecified => "THEME_PREFERENCE_UNSPECIFIED",
2143            Self::Light => "THEME_PREFERENCE_LIGHT",
2144            Self::Dark => "THEME_PREFERENCE_DARK",
2145            Self::System => "THEME_PREFERENCE_SYSTEM",
2146        }
2147    }
2148    /// Creates an enum from field names used in the ProtoBuf definition.
2149    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2150        match value {
2151            "THEME_PREFERENCE_UNSPECIFIED" => Some(Self::Unspecified),
2152            "THEME_PREFERENCE_LIGHT" => Some(Self::Light),
2153            "THEME_PREFERENCE_DARK" => Some(Self::Dark),
2154            "THEME_PREFERENCE_SYSTEM" => Some(Self::System),
2155            _ => None,
2156        }
2157    }
2158}
2159// ─── Messages ───────────────────────────────────────────────────────────────
2160
2161/// A named collection of users within an organization, used for campaign
2162/// audience targeting (recipient groups).
2163#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2164pub struct Group {
2165    /// Unique identifier for the group.
2166    #[prost(string, tag="1")]
2167    pub id: ::prost::alloc::string::String,
2168    /// Human-readable display name (unique within the organization).
2169    /// Constraints: Max length 200 characters.
2170    #[prost(string, tag="2")]
2171    pub name: ::prost::alloc::string::String,
2172    /// Optional description of the group's purpose.
2173    /// Constraints: Max length 1000 characters.
2174    #[prost(string, tag="3")]
2175    pub description: ::prost::alloc::string::String,
2176    /// Number of users currently in the group.
2177    #[prost(int32, tag="4")]
2178    pub member_count: i32,
2179    /// Timestamp when the group was created.
2180    #[prost(message, optional, tag="5")]
2181    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
2182    /// Timestamp when the group was last updated.
2183    #[prost(message, optional, tag="6")]
2184    pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
2185    /// Whether this is the organization's default group (cannot be deleted or renamed).
2186    #[prost(bool, tag="7")]
2187    pub is_default: bool,
2188    /// ID of the user who created this group. Empty for system-seeded defaults.
2189    #[prost(string, tag="8")]
2190    pub created_by: ::prost::alloc::string::String,
2191}
2192/// Request to create a new group.
2193#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2194pub struct CreateGroupRequest {
2195    /// Display name for the group. Required.
2196    /// Constraints: Max length 200 characters.
2197    #[prost(string, tag="1")]
2198    pub name: ::prost::alloc::string::String,
2199    /// Optional description.
2200    /// Constraints: Max length 1000 characters.
2201    #[prost(string, tag="2")]
2202    pub description: ::prost::alloc::string::String,
2203}
2204/// Response after creating a group.
2205#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2206pub struct CreateGroupResponse {
2207    /// The newly created group.
2208    #[prost(message, optional, tag="1")]
2209    pub group: ::core::option::Option<Group>,
2210}
2211/// Request to retrieve a group by ID.
2212#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2213pub struct GetGroupRequest {
2214    /// ID of the group to retrieve. Required.
2215    #[prost(string, tag="1")]
2216    pub group_id: ::prost::alloc::string::String,
2217}
2218/// Response containing the requested group.
2219#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2220pub struct GetGroupResponse {
2221    /// The requested group.
2222    #[prost(message, optional, tag="1")]
2223    pub group: ::core::option::Option<Group>,
2224}
2225/// Request to list groups in the organization with pagination.
2226#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2227pub struct ListGroupsRequest {
2228    /// Pagination parameters.
2229    #[prost(message, optional, tag="1")]
2230    pub pagination: ::core::option::Option<Pagination>,
2231}
2232/// Response containing a page of groups.
2233#[derive(Clone, PartialEq, ::prost::Message)]
2234pub struct ListGroupsResponse {
2235    /// Groups in this page.
2236    #[prost(message, repeated, tag="1")]
2237    pub groups: ::prost::alloc::vec::Vec<Group>,
2238    /// Pagination metadata for fetching subsequent pages.
2239    #[prost(message, optional, tag="2")]
2240    pub pagination_meta: ::core::option::Option<PaginationMeta>,
2241}
2242/// Request to update a group's name and/or description.
2243#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2244pub struct UpdateGroupRequest {
2245    /// ID of the group to update. Required.
2246    #[prost(string, tag="1")]
2247    pub group_id: ::prost::alloc::string::String,
2248    /// New display name. If empty, the name is not changed.
2249    /// Default groups cannot be renamed.
2250    /// Constraints: Max length 200 characters.
2251    #[prost(string, tag="2")]
2252    pub name: ::prost::alloc::string::String,
2253    /// New description. If empty, the description is not changed.
2254    /// Constraints: Max length 1000 characters.
2255    #[prost(string, tag="3")]
2256    pub description: ::prost::alloc::string::String,
2257}
2258/// Response after updating a group.
2259#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2260pub struct UpdateGroupResponse {
2261    /// The updated group.
2262    #[prost(message, optional, tag="1")]
2263    pub group: ::core::option::Option<Group>,
2264}
2265/// Request to delete a group.
2266#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2267pub struct DeleteGroupRequest {
2268    /// ID of the group to delete. Required.
2269    /// Default groups cannot be deleted.
2270    #[prost(string, tag="1")]
2271    pub group_id: ::prost::alloc::string::String,
2272}
2273/// Response after deleting a group.
2274#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2275pub struct DeleteGroupResponse {
2276}
2277/// Request to add users to a group.
2278#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2279pub struct AddGroupMembersRequest {
2280    /// ID of the group to add members to. Required.
2281    #[prost(string, tag="1")]
2282    pub group_id: ::prost::alloc::string::String,
2283    /// IDs of users to add. Must belong to the same organization.
2284    /// Adding an existing member is a no-op (idempotent).
2285    /// Constraints: Max 100 user IDs per request.
2286    #[prost(string, repeated, tag="2")]
2287    pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2288}
2289/// Response after adding group members.
2290#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2291pub struct AddGroupMembersResponse {
2292    /// The group with updated member_count.
2293    #[prost(message, optional, tag="1")]
2294    pub group: ::core::option::Option<Group>,
2295}
2296/// Request to remove users from a group.
2297#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2298pub struct RemoveGroupMembersRequest {
2299    /// ID of the group to remove members from. Required.
2300    #[prost(string, tag="1")]
2301    pub group_id: ::prost::alloc::string::String,
2302    /// IDs of users to remove. Removing a non-member is a no-op (idempotent).
2303    /// Constraints: Max 100 user IDs per request.
2304    #[prost(string, repeated, tag="2")]
2305    pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2306}
2307/// Response after removing group members.
2308#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2309pub struct RemoveGroupMembersResponse {
2310    /// The group with updated member_count.
2311    #[prost(message, optional, tag="1")]
2312    pub group: ::core::option::Option<Group>,
2313}
2314/// Request to list members of a group with pagination.
2315#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2316pub struct ListGroupMembersRequest {
2317    /// ID of the group whose members to list. Required.
2318    #[prost(string, tag="1")]
2319    pub group_id: ::prost::alloc::string::String,
2320    /// Pagination parameters.
2321    #[prost(message, optional, tag="2")]
2322    pub pagination: ::core::option::Option<Pagination>,
2323}
2324/// Response containing a page of group members.
2325#[derive(Clone, PartialEq, ::prost::Message)]
2326pub struct ListGroupMembersResponse {
2327    /// Users in this page.
2328    #[prost(message, repeated, tag="1")]
2329    pub users: ::prost::alloc::vec::Vec<User>,
2330    /// Pagination metadata for fetching subsequent pages.
2331    #[prost(message, optional, tag="2")]
2332    pub pagination_meta: ::core::option::Option<PaginationMeta>,
2333}
2334/// A group membership entry for batch lookups.
2335#[derive(Clone, PartialEq, ::prost::Message)]
2336pub struct UserGroupMembership {
2337    /// ID of the user.
2338    #[prost(string, tag="1")]
2339    pub user_id: ::prost::alloc::string::String,
2340    /// Groups the user belongs to.
2341    #[prost(message, repeated, tag="2")]
2342    pub groups: ::prost::alloc::vec::Vec<Group>,
2343}
2344/// Request to get group memberships for a batch of users.
2345#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2346pub struct GetUserGroupMembershipsRequest {
2347    /// IDs of users to look up. Required.
2348    /// Constraints: Max 200 user IDs per request.
2349    #[prost(string, repeated, tag="1")]
2350    pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2351}
2352/// Response containing group memberships for the requested users.
2353#[derive(Clone, PartialEq, ::prost::Message)]
2354pub struct GetUserGroupMembershipsResponse {
2355    /// Group memberships per user. Only users with at least one group are included.
2356    #[prost(message, repeated, tag="1")]
2357    pub memberships: ::prost::alloc::vec::Vec<UserGroupMembership>,
2358}
2359// ─── Messages ───────────────────────────────────────────────────────────────
2360
2361/// A single touch event captured from the mobile app.
2362#[derive(Clone, PartialEq, ::prost::Message)]
2363pub struct TouchEvent {
2364    /// Screen name from React Navigation route.
2365    /// Constraints: Max length 200 characters.
2366    #[prost(string, tag="1")]
2367    pub screen_name: ::prost::alloc::string::String,
2368    /// Horizontal coordinate as a percentage of screen width (0.0–1.0).
2369    /// Constraints: Range 0.0 to 1.0 inclusive.
2370    #[prost(float, tag="2")]
2371    pub x_pct: f32,
2372    /// Vertical coordinate as a percentage of screen height (0.0–1.0).
2373    /// Constraints: Range 0.0 to 1.0 inclusive.
2374    #[prost(float, tag="3")]
2375    pub y_pct: f32,
2376    /// Type of touch event.
2377    #[prost(enumeration="TouchEventType", tag="4")]
2378    pub event_type: i32,
2379    /// Screen width in device pixels at the time of capture.
2380    #[prost(int32, tag="5")]
2381    pub screen_width: i32,
2382    /// Screen height in device pixels at the time of capture.
2383    #[prost(int32, tag="6")]
2384    pub screen_height: i32,
2385    /// Client-side timestamp when the touch occurred.
2386    #[prost(message, optional, tag="7")]
2387    pub client_timestamp: ::core::option::Option<::prost_types::Timestamp>,
2388    /// Campaign ID if the touch occurred during a campaign message view.
2389    /// Empty string for organic (non-campaign) navigation.
2390    #[prost(string, tag="8")]
2391    pub campaign_id: ::prost::alloc::string::String,
2392}
2393/// Request to ingest a batch of touch events from the mobile app.
2394#[derive(Clone, PartialEq, ::prost::Message)]
2395pub struct IngestTouchEventsRequest {
2396    /// Batch of touch events to ingest.
2397    /// Constraints: Max 100 events per batch.
2398    #[prost(message, repeated, tag="1")]
2399    pub events: ::prost::alloc::vec::Vec<TouchEvent>,
2400}
2401/// Response after ingesting touch events.
2402#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2403pub struct IngestTouchEventsResponse {
2404    /// Number of events successfully ingested.
2405    #[prost(int32, tag="1")]
2406    pub ingested_count: i32,
2407}
2408/// A single aggregated data point in a heatmap grid cell.
2409#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2410pub struct HeatmapDataPoint {
2411    /// Grid cell horizontal center as a percentage (0.0–1.0).
2412    #[prost(float, tag="1")]
2413    pub x_pct: f32,
2414    /// Grid cell vertical center as a percentage (0.0–1.0).
2415    #[prost(float, tag="2")]
2416    pub y_pct: f32,
2417    /// Aggregated value for this cell (count, median, or z-score depending on mode).
2418    #[prost(float, tag="3")]
2419    pub value: f32,
2420}
2421/// Request to query aggregated heatmap data for a screen.
2422#[derive(Clone, PartialEq, ::prost::Message)]
2423pub struct QueryHeatmapDataRequest {
2424    /// Screen name to query.
2425    /// Constraints: Max length 200 characters.
2426    #[prost(string, tag="1")]
2427    pub screen_name: ::prost::alloc::string::String,
2428    /// Start of the time range filter (inclusive).
2429    #[prost(message, optional, tag="2")]
2430    pub date_from: ::core::option::Option<::prost_types::Timestamp>,
2431    /// End of the time range filter (inclusive).
2432    #[prost(message, optional, tag="3")]
2433    pub date_to: ::core::option::Option<::prost_types::Timestamp>,
2434    /// Optional: filter by campaign ID.
2435    /// Constraints: UUID format (36 characters).
2436    #[prost(string, tag="4")]
2437    pub campaign_id: ::prost::alloc::string::String,
2438    /// Grid resolution for coordinate rounding. Default: 0.02 (50×50 grid).
2439    /// Constraints: Range 0.005 to 0.1.
2440    #[prost(float, tag="6")]
2441    pub grid_resolution: f32,
2442    /// Aggregation mode (TOTAL or MEDIAN).
2443    #[prost(enumeration="HeatmapMode", tag="7")]
2444    pub mode: i32,
2445    /// Optional: filter by event types. Empty list means all types.
2446    #[prost(enumeration="TouchEventType", repeated, tag="8")]
2447    pub event_types: ::prost::alloc::vec::Vec<i32>,
2448}
2449/// Response containing aggregated heatmap data.
2450#[derive(Clone, PartialEq, ::prost::Message)]
2451pub struct QueryHeatmapDataResponse {
2452    /// Aggregated data points for heatmap rendering.
2453    #[prost(message, repeated, tag="1")]
2454    pub data_points: ::prost::alloc::vec::Vec<HeatmapDataPoint>,
2455    /// URL to a mobile-captured screenshot for this screen, if available.
2456    /// Empty string when no screenshot exists.
2457    #[prost(string, tag="3")]
2458    pub screenshot_url: ::prost::alloc::string::String,
2459    /// Whether per-cohort bucket breakdowns are available (k >= 5).
2460    #[prost(bool, tag="4")]
2461    pub cohort_enabled: bool,
2462}
2463/// Request to upload a screenshot captured from the mobile app.
2464#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2465pub struct UploadScreenshotRequest {
2466    /// Screen name matching React Navigation route (e.g. "MessageDetail::<campaign_uuid>").
2467    /// Constraints: Max length 200 characters.
2468    #[prost(string, tag="1")]
2469    pub screen_name: ::prost::alloc::string::String,
2470    /// App version that captured the screenshot (e.g. "1.15.0").
2471    #[prost(string, tag="2")]
2472    pub app_version: ::prost::alloc::string::String,
2473    /// PNG image data.
2474    /// Constraints: Max 512KB.
2475    #[prost(bytes="vec", tag="3")]
2476    pub image_data: ::prost::alloc::vec::Vec<u8>,
2477}
2478/// Response after uploading a screenshot.
2479#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2480pub struct UploadScreenshotResponse {
2481    /// S3 URL where the screenshot was stored.
2482    #[prost(string, tag="1")]
2483    pub url: ::prost::alloc::string::String,
2484}
2485/// A screen screenshot stored as a static asset.
2486#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2487pub struct ScreenScreenshot {
2488    /// Screen name matching React Navigation route.
2489    #[prost(string, tag="1")]
2490    pub screen_name: ::prost::alloc::string::String,
2491    /// S3 URL to the screenshot image.
2492    #[prost(string, tag="2")]
2493    pub url: ::prost::alloc::string::String,
2494    /// App version this screenshot corresponds to.
2495    #[prost(string, tag="3")]
2496    pub app_version: ::prost::alloc::string::String,
2497}
2498/// Request to list available screen screenshots.
2499#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2500pub struct ListScreenshotsRequest {
2501}
2502/// Response containing available screen screenshots.
2503#[derive(Clone, PartialEq, ::prost::Message)]
2504pub struct ListScreenshotsResponse {
2505    /// Available screen screenshots with their URLs and versions.
2506    #[prost(message, repeated, tag="1")]
2507    pub screenshots: ::prost::alloc::vec::Vec<ScreenScreenshot>,
2508}
2509// ─── Enums ──────────────────────────────────────────────────────────────────
2510
2511/// Type of touch event captured on the mobile app.
2512#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2513#[repr(i32)]
2514pub enum TouchEventType {
2515    /// Default value; not a valid event type.
2516    Unspecified = 0,
2517    /// A single tap on the screen.
2518    Tap = 1,
2519    /// A long press (held for 500ms+).
2520    LongPress = 2,
2521    /// A periodic scroll position sample (viewport midpoint every 2s).
2522    Scroll = 3,
2523    /// The user tapped an action button (e.g. "Acknowledge").
2524    ActionClick = 4,
2525}
2526impl TouchEventType {
2527    /// String value of the enum field names used in the ProtoBuf definition.
2528    ///
2529    /// The values are not transformed in any way and thus are considered stable
2530    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2531    pub fn as_str_name(&self) -> &'static str {
2532        match self {
2533            Self::Unspecified => "TOUCH_EVENT_TYPE_UNSPECIFIED",
2534            Self::Tap => "TOUCH_EVENT_TYPE_TAP",
2535            Self::LongPress => "TOUCH_EVENT_TYPE_LONG_PRESS",
2536            Self::Scroll => "TOUCH_EVENT_TYPE_SCROLL",
2537            Self::ActionClick => "TOUCH_EVENT_TYPE_ACTION_CLICK",
2538        }
2539    }
2540    /// Creates an enum from field names used in the ProtoBuf definition.
2541    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2542        match value {
2543            "TOUCH_EVENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2544            "TOUCH_EVENT_TYPE_TAP" => Some(Self::Tap),
2545            "TOUCH_EVENT_TYPE_LONG_PRESS" => Some(Self::LongPress),
2546            "TOUCH_EVENT_TYPE_SCROLL" => Some(Self::Scroll),
2547            "TOUCH_EVENT_TYPE_ACTION_CLICK" => Some(Self::ActionClick),
2548            _ => None,
2549        }
2550    }
2551}
2552/// Aggregation mode for heatmap data queries.
2553#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2554#[repr(i32)]
2555pub enum HeatmapMode {
2556    /// Default value; not a valid mode.
2557    Unspecified = 0,
2558    /// Sum of all cohort buckets' touches per grid cell (default).
2559    Total = 1,
2560    /// Median touch count per grid cell across cohort buckets.
2561    Median = 2,
2562}
2563impl HeatmapMode {
2564    /// String value of the enum field names used in the ProtoBuf definition.
2565    ///
2566    /// The values are not transformed in any way and thus are considered stable
2567    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2568    pub fn as_str_name(&self) -> &'static str {
2569        match self {
2570            Self::Unspecified => "HEATMAP_MODE_UNSPECIFIED",
2571            Self::Total => "HEATMAP_MODE_TOTAL",
2572            Self::Median => "HEATMAP_MODE_MEDIAN",
2573        }
2574    }
2575    /// Creates an enum from field names used in the ProtoBuf definition.
2576    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2577        match value {
2578            "HEATMAP_MODE_UNSPECIFIED" => Some(Self::Unspecified),
2579            "HEATMAP_MODE_TOTAL" => Some(Self::Total),
2580            "HEATMAP_MODE_MEDIAN" => Some(Self::Median),
2581            _ => None,
2582        }
2583    }
2584}
2585// ─── Messages ───────────────────────────────────────────────────────────────
2586
2587/// A single entry in a user's inbox, combining a message with its delivery state.
2588#[derive(Clone, PartialEq, ::prost::Message)]
2589pub struct InboxEntry {
2590    /// ID of the delivery record for this inbox entry.
2591    /// Constraints: UUID format (36 characters).
2592    #[prost(string, tag="1")]
2593    pub delivery_id: ::prost::alloc::string::String,
2594    /// The fully rendered message content.
2595    #[prost(message, optional, tag="2")]
2596    pub message: ::core::option::Option<Message>,
2597    /// Current delivery status (e.g. DELIVERED, ACKNOWLEDGED).
2598    #[prost(enumeration="DeliveryStatus", tag="3")]
2599    pub status: i32,
2600    /// Whether the user has read this message.
2601    #[prost(bool, tag="4")]
2602    pub read: bool,
2603    /// Timestamp when the message was received in the inbox.
2604    #[prost(message, optional, tag="5")]
2605    pub received_at: ::core::option::Option<::prost_types::Timestamp>,
2606}
2607/// Request to sync inbox entries since a given timestamp.
2608#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2609pub struct SyncRequest {
2610    /// Fetch entries newer than this timestamp. Omit for initial sync.
2611    #[prost(message, optional, tag="1")]
2612    pub since: ::core::option::Option<::prost_types::Timestamp>,
2613    /// Maximum number of entries to return.
2614    /// Constraints: Valid range 1 to 200.
2615    #[prost(int32, tag="2")]
2616    pub limit: i32,
2617}
2618/// Response containing synced inbox entries.
2619#[derive(Clone, PartialEq, ::prost::Message)]
2620pub struct SyncResponse {
2621    /// Inbox entries newer than the requested timestamp.
2622    #[prost(message, repeated, tag="1")]
2623    pub entries: ::prost::alloc::vec::Vec<InboxEntry>,
2624    /// Cursor timestamp to use for the next sync call.
2625    #[prost(message, optional, tag="2")]
2626    pub next_since: ::core::option::Option<::prost_types::Timestamp>,
2627}
2628/// Request to mark a message as read.
2629#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2630pub struct MarkReadRequest {
2631    /// ID of the delivery to mark as read.
2632    /// Constraints: UUID format (36 characters).
2633    #[prost(string, tag="1")]
2634    pub delivery_id: ::prost::alloc::string::String,
2635}
2636/// Response after marking a message as read.
2637#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2638pub struct MarkReadResponse {
2639    /// Whether the read status was successfully updated.
2640    #[prost(bool, tag="1")]
2641    pub success: bool,
2642}
2643/// Request to retrieve a single message by delivery ID.
2644#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2645pub struct GetMessageRequest {
2646    /// ID of the delivery to retrieve.
2647    /// Constraints: UUID format (36 characters).
2648    #[prost(string, tag="1")]
2649    pub delivery_id: ::prost::alloc::string::String,
2650}
2651/// Response containing the requested inbox entry.
2652#[derive(Clone, PartialEq, ::prost::Message)]
2653pub struct GetMessageResponse {
2654    /// The inbox entry for the requested delivery.
2655    #[prost(message, optional, tag="1")]
2656    pub entry: ::core::option::Option<InboxEntry>,
2657}
2658// ─── Messages ───────────────────────────────────────────────────────────────
2659
2660/// A behavioral archetype describing a cohort pattern (never an individual).
2661/// Derived from k-anonymized, DP-noised behavioral feature vectors.
2662#[derive(Clone, PartialEq, ::prost::Message)]
2663pub struct Archetype {
2664    /// Human-readable label (e.g., "Swift Acknowledger", "Thorough Reader").
2665    #[prost(string, tag="1")]
2666    pub label: ::prost::alloc::string::String,
2667    /// Description of the behavioral pattern this archetype represents.
2668    #[prost(string, tag="2")]
2669    pub description: ::prost::alloc::string::String,
2670    /// Proportion of the group that belongs to this archetype (0.0-1.0).
2671    #[prost(float, tag="3")]
2672    pub percentage: f32,
2673    /// Centroid of the behavioral feature vector for this archetype.
2674    /// Keys are dimension names (e.g., "tap_density", "engagement_depth").
2675    #[prost(map="string, double", tag="4")]
2676    pub feature_centroid: ::std::collections::HashMap<::prost::alloc::string::String, f64>,
2677}
2678/// A cohort-level prediction for campaign acknowledgment rate.
2679/// Never targets or scores individuals — always represents an audience aggregate.
2680#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2681pub struct CohortPrediction {
2682    /// Predicted ACK rate for the audience (0.0-1.0).
2683    #[prost(float, tag="1")]
2684    pub predicted_ack_rate: f32,
2685    /// Lower bound of the confidence interval.
2686    #[prost(float, tag="2")]
2687    pub confidence_low: f32,
2688    /// Upper bound of the confidence interval.
2689    #[prost(float, tag="3")]
2690    pub confidence_high: f32,
2691    /// Confidence level based on available data volume.
2692    #[prost(enumeration="ConfidenceLevel", tag="4")]
2693    pub confidence_level: i32,
2694    /// Number of anonymous data points used for this prediction.
2695    #[prost(int32, tag="5")]
2696    pub data_point_count: i32,
2697}
2698/// Advisory information for campaign configuration, combining predictions and archetypes.
2699#[derive(Clone, PartialEq, ::prost::Message)]
2700pub struct CampaignAdvisory {
2701    /// Cohort-level ACK prediction for the target audience.
2702    #[prost(message, optional, tag="1")]
2703    pub predicted_ack: ::core::option::Option<CohortPrediction>,
2704    /// Suggested escalation delay in minutes based on historical cohort patterns.
2705    /// 0 if insufficient data.
2706    #[prost(int32, tag="2")]
2707    pub suggested_escalation_delay_minutes: i32,
2708    /// Behavioral archetypes for the target audience.
2709    #[prost(message, repeated, tag="3")]
2710    pub archetypes: ::prost::alloc::vec::Vec<Archetype>,
2711}
2712/// Request to retrieve behavioral archetypes for a group.
2713#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2714pub struct GetGroupArchetypesRequest {
2715    /// ID of the group to query archetypes for. Required.
2716    #[prost(string, tag="1")]
2717    pub group_id: ::prost::alloc::string::String,
2718}
2719/// Response containing behavioral archetypes for a group.
2720#[derive(Clone, PartialEq, ::prost::Message)]
2721pub struct GetGroupArchetypesResponse {
2722    /// Behavioral archetypes for the group (empty if insufficient data).
2723    #[prost(message, repeated, tag="1")]
2724    pub archetypes: ::prost::alloc::vec::Vec<Archetype>,
2725    /// Number of anonymous feature vectors used for clustering.
2726    #[prost(int32, tag="2")]
2727    pub data_point_count: i32,
2728}
2729/// Request to predict cohort-level ACK rate for a campaign configuration.
2730#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2731pub struct PredictCampaignAckRequest {
2732    /// ID of the target audience group. Required.
2733    #[prost(string, tag="1")]
2734    pub group_id: ::prost::alloc::string::String,
2735    /// Template type (optional, for prediction refinement).
2736    #[prost(string, tag="2")]
2737    pub template_type: ::prost::alloc::string::String,
2738    /// Number of workflow steps (optional, for prediction refinement).
2739    #[prost(int32, tag="3")]
2740    pub workflow_step_count: i32,
2741}
2742/// Response containing a cohort-level ACK prediction.
2743#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2744pub struct PredictCampaignAckResponse {
2745    /// Cohort-level prediction.
2746    #[prost(message, optional, tag="1")]
2747    pub prediction: ::core::option::Option<CohortPrediction>,
2748}
2749/// Request for campaign configuration advisory.
2750#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2751pub struct GetCampaignAdvisoryRequest {
2752    /// ID of the target audience group. Required.
2753    #[prost(string, tag="1")]
2754    pub group_id: ::prost::alloc::string::String,
2755    /// Template ID (optional, for advisory context).
2756    #[prost(string, tag="2")]
2757    pub template_id: ::prost::alloc::string::String,
2758    /// Template version (optional).
2759    #[prost(int32, tag="3")]
2760    pub template_version: i32,
2761    /// Number of workflow steps (optional).
2762    #[prost(int32, tag="4")]
2763    pub workflow_step_count: i32,
2764}
2765/// Response containing campaign advisory information.
2766#[derive(Clone, PartialEq, ::prost::Message)]
2767pub struct GetCampaignAdvisoryResponse {
2768    /// Campaign advisory with prediction, suggested escalation, and archetypes.
2769    #[prost(message, optional, tag="1")]
2770    pub advisory: ::core::option::Option<CampaignAdvisory>,
2771}
2772/// Request to generate an AI narrative for a group's insights.
2773#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2774pub struct GetInsightNarrativeRequest {
2775    /// ID of the group to generate a narrative for. Required.
2776    #[prost(string, tag="1")]
2777    pub group_id: ::prost::alloc::string::String,
2778    /// Name of the prompt template to use (e.g., "campaign-advisory", "archetype-explanation").
2779    #[prost(string, tag="2")]
2780    pub prompt_name: ::prost::alloc::string::String,
2781}
2782/// Response containing an AI-generated narrative.
2783#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2784pub struct GetInsightNarrativeResponse {
2785    /// AI-generated narrative text (Markdown formatted).
2786    #[prost(string, tag="1")]
2787    pub narrative: ::prost::alloc::string::String,
2788    /// Timestamp when the narrative was generated.
2789    #[prost(message, optional, tag="2")]
2790    pub generated_at: ::core::option::Option<::prost_types::Timestamp>,
2791    /// Model identifier used for generation.
2792    #[prost(string, tag="3")]
2793    pub model_id: ::prost::alloc::string::String,
2794}
2795/// Request to manually trigger the ML training pipeline.
2796/// Empty — organization is extracted from the JWT.
2797#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2798pub struct TriggerMlPipelineRequest {
2799}
2800/// Response after triggering the ML pipeline.
2801#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2802pub struct TriggerMlPipelineResponse {
2803    /// Remaining manual retrains allowed this month.
2804    #[prost(int32, tag="1")]
2805    pub remaining_this_month: i32,
2806    /// Timestamp of the last successful training (null if never trained).
2807    #[prost(message, optional, tag="2")]
2808    pub last_trained_at: ::core::option::Option<::prost_types::Timestamp>,
2809}
2810// ─── Enums ──────────────────────────────────────────────────────────────────
2811
2812/// Confidence level for cohort-level predictions, based on available data volume.
2813#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2814#[repr(i32)]
2815pub enum ConfidenceLevel {
2816    Unspecified = 0,
2817    /// Fewer than 50 campaigns — predictions based on heuristics/industry benchmarks.
2818    Low = 1,
2819    /// 50-200 campaigns — basic clustering available, wide confidence intervals.
2820    Medium = 2,
2821    /// 200+ campaigns — full ML pipeline, narrow confidence intervals.
2822    High = 3,
2823}
2824impl ConfidenceLevel {
2825    /// String value of the enum field names used in the ProtoBuf definition.
2826    ///
2827    /// The values are not transformed in any way and thus are considered stable
2828    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2829    pub fn as_str_name(&self) -> &'static str {
2830        match self {
2831            Self::Unspecified => "CONFIDENCE_LEVEL_UNSPECIFIED",
2832            Self::Low => "CONFIDENCE_LEVEL_LOW",
2833            Self::Medium => "CONFIDENCE_LEVEL_MEDIUM",
2834            Self::High => "CONFIDENCE_LEVEL_HIGH",
2835        }
2836    }
2837    /// Creates an enum from field names used in the ProtoBuf definition.
2838    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2839        match value {
2840            "CONFIDENCE_LEVEL_UNSPECIFIED" => Some(Self::Unspecified),
2841            "CONFIDENCE_LEVEL_LOW" => Some(Self::Low),
2842            "CONFIDENCE_LEVEL_MEDIUM" => Some(Self::Medium),
2843            "CONFIDENCE_LEVEL_HIGH" => Some(Self::High),
2844            _ => None,
2845        }
2846    }
2847}
2848// ─── Messages ───────────────────────────────────────────────────────────────
2849
2850/// A shareable invite link that allows users to self-join an organization.
2851/// Links carry a role assignment and optional usage/expiry constraints.
2852#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2853pub struct InviteLink {
2854    /// Unique identifier for the invite link.
2855    #[prost(string, tag="1")]
2856    pub id: ::prost::alloc::string::String,
2857    /// Cryptographically random base64url-encoded token (43 characters).
2858    #[prost(string, tag="2")]
2859    pub token: ::prost::alloc::string::String,
2860    /// ID of the role assigned to users who redeem this link.
2861    #[prost(string, tag="3")]
2862    pub role_id: ::prost::alloc::string::String,
2863    /// Maximum number of times this link can be redeemed.
2864    /// 0 means unlimited.
2865    #[prost(int32, tag="4")]
2866    pub max_uses: i32,
2867    /// Number of times this link has been redeemed.
2868    #[prost(int32, tag="5")]
2869    pub use_count: i32,
2870    /// When the link expires. Empty if no expiry.
2871    #[prost(message, optional, tag="6")]
2872    pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
2873    /// When the link was revoked. Empty if not revoked.
2874    #[prost(message, optional, tag="7")]
2875    pub revoked_at: ::core::option::Option<::prost_types::Timestamp>,
2876    /// ID of the admin who created the link.
2877    #[prost(string, tag="8")]
2878    pub created_by: ::prost::alloc::string::String,
2879    /// When the link was created.
2880    #[prost(message, optional, tag="9")]
2881    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
2882    /// Data governance region assigned to users who redeem this link. Empty means inherit from org default.
2883    /// Valid values: EU, LATAM, BR, APAC, US.
2884    #[prost(string, tag="10")]
2885    pub data_governance_region: ::prost::alloc::string::String,
2886}
2887/// Request to create a new invite link for the organization.
2888#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2889pub struct CreateInviteLinkRequest {
2890    /// ID of the role to assign. Defaults to the organization's employee role if empty.
2891    #[prost(string, tag="1")]
2892    pub role_id: ::prost::alloc::string::String,
2893    /// Maximum number of redemptions. 0 means unlimited.
2894    #[prost(int32, tag="2")]
2895    pub max_uses: i32,
2896    /// Number of hours until the link expires. 0 means no expiry.
2897    /// Constraints: Valid range 0 to 8760 (1 year).
2898    #[prost(int32, tag="3")]
2899    pub expires_in_hours: i32,
2900    /// Optional data governance region. Users who redeem this link inherit this region. Empty means inherit from org default.
2901    /// Valid values: EU, LATAM, BR, APAC, US.
2902    #[prost(string, tag="4")]
2903    pub data_governance_region: ::prost::alloc::string::String,
2904}
2905/// Response after creating an invite link.
2906#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2907pub struct CreateInviteLinkResponse {
2908    /// The newly created invite link.
2909    #[prost(message, optional, tag="1")]
2910    pub invite_link: ::core::option::Option<InviteLink>,
2911    /// Full URL for sharing (e.g. "<https://app.pidgr.com/join?token=<TOKEN>">).
2912    #[prost(string, tag="2")]
2913    pub url: ::prost::alloc::string::String,
2914}
2915/// Request to list all invite links for the organization.
2916#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2917pub struct ListInviteLinksRequest {
2918}
2919/// Response containing all invite links for the organization.
2920#[derive(Clone, PartialEq, ::prost::Message)]
2921pub struct ListInviteLinksResponse {
2922    /// All invite links (active, expired, maxed-out, and revoked), ordered by creation date descending.
2923    #[prost(message, repeated, tag="1")]
2924    pub invite_links: ::prost::alloc::vec::Vec<InviteLink>,
2925}
2926/// Request to revoke an invite link.
2927#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2928pub struct RevokeInviteLinkRequest {
2929    /// ID of the invite link to revoke. Required.
2930    #[prost(string, tag="1")]
2931    pub invite_link_id: ::prost::alloc::string::String,
2932}
2933/// Response after revoking an invite link.
2934#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2935pub struct RevokeInviteLinkResponse {
2936}
2937/// Request to redeem an invite link (authenticated — email extracted from JWT).
2938#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2939pub struct RedeemInviteLinkRequest {
2940    /// The invite link token from the URL query parameter.
2941    #[prost(string, tag="1")]
2942    pub token: ::prost::alloc::string::String,
2943}
2944/// Response after redeeming an invite link.
2945#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2946pub struct RedeemInviteLinkResponse {
2947    /// Name of the organization the user was added to.
2948    #[prost(string, tag="1")]
2949    pub organization_name: ::prost::alloc::string::String,
2950}
2951/// Request to validate an invite link and provision a user account if needed (unauthenticated).
2952#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2953pub struct ValidateInviteLinkRequest {
2954    /// The invite link token from the URL query parameter.
2955    #[prost(string, tag="1")]
2956    pub token: ::prost::alloc::string::String,
2957    /// Email address of the user joining the organization.
2958    /// Constraints: Max length 254 characters (RFC 5321).
2959    #[prost(string, tag="2")]
2960    pub email: ::prost::alloc::string::String,
2961}
2962/// Response after validating an invite link.
2963#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2964pub struct ValidateInviteLinkResponse {
2965    /// Name of the organization the invite link belongs to.
2966    #[prost(string, tag="1")]
2967    pub organization_name: ::prost::alloc::string::String,
2968}
2969// ─── Messages ───────────────────────────────────────────────────────────────
2970
2971/// Request to invite a new user to the organization.
2972#[derive(Clone, PartialEq, ::prost::Message)]
2973pub struct InviteUserRequest {
2974    /// Email address to send the invitation to.
2975    /// Constraints: Max length 254 characters (RFC 5321).
2976    #[prost(string, tag="1")]
2977    pub email: ::prost::alloc::string::String,
2978    /// Display name for the invited user.
2979    /// Constraints: Max length 200 characters.
2980    #[prost(string, tag="2")]
2981    pub name: ::prost::alloc::string::String,
2982    /// ID of the role to assign. Defaults to the organization's employee role if empty.
2983    #[prost(string, tag="4")]
2984    pub role_id: ::prost::alloc::string::String,
2985    /// Optional profile attributes to pre-fill at invitation time.
2986    #[prost(message, optional, tag="5")]
2987    pub profile: ::core::option::Option<UserProfile>,
2988    /// Optional data governance region for the invited user. Empty means inherit from org default.
2989    /// Valid values: EU, LATAM, BR, APAC, US.
2990    #[prost(string, tag="6")]
2991    pub data_governance_region: ::prost::alloc::string::String,
2992}
2993/// Response after inviting a user.
2994#[derive(Clone, PartialEq, ::prost::Message)]
2995pub struct InviteUserResponse {
2996    /// The newly created user (status: INVITED).
2997    #[prost(message, optional, tag="1")]
2998    pub user: ::core::option::Option<User>,
2999}
3000/// Request to retrieve a user by ID.
3001#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3002pub struct GetUserRequest {
3003    /// ID of the user to retrieve.
3004    #[prost(string, tag="1")]
3005    pub user_id: ::prost::alloc::string::String,
3006}
3007/// Response containing the requested user.
3008#[derive(Clone, PartialEq, ::prost::Message)]
3009pub struct GetUserResponse {
3010    /// The requested user.
3011    #[prost(message, optional, tag="1")]
3012    pub user: ::core::option::Option<User>,
3013}
3014/// Request to list users in the organization with pagination.
3015#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3016pub struct ListUsersRequest {
3017    /// Pagination parameters.
3018    #[prost(message, optional, tag="1")]
3019    pub pagination: ::core::option::Option<Pagination>,
3020}
3021/// Response containing a page of users.
3022#[derive(Clone, PartialEq, ::prost::Message)]
3023pub struct ListUsersResponse {
3024    /// List of users in this page.
3025    #[prost(message, repeated, tag="1")]
3026    pub users: ::prost::alloc::vec::Vec<User>,
3027    /// Pagination metadata for fetching subsequent pages.
3028    #[prost(message, optional, tag="2")]
3029    pub pagination_meta: ::core::option::Option<PaginationMeta>,
3030}
3031/// Request to change a user's role within the organization.
3032#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3033pub struct UpdateUserRoleRequest {
3034    /// ID of the user whose role to update.
3035    #[prost(string, tag="1")]
3036    pub user_id: ::prost::alloc::string::String,
3037    /// ID of the new role to assign.
3038    #[prost(string, tag="2")]
3039    pub role_id: ::prost::alloc::string::String,
3040}
3041/// Response after updating a user's role.
3042#[derive(Clone, PartialEq, ::prost::Message)]
3043pub struct UpdateUserRoleResponse {
3044    /// The updated user with the new role.
3045    #[prost(message, optional, tag="1")]
3046    pub user: ::core::option::Option<User>,
3047}
3048/// Request to deactivate a user within the organization.
3049#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3050pub struct DeactivateUserRequest {
3051    /// ID of the user to deactivate.
3052    #[prost(string, tag="1")]
3053    pub user_id: ::prost::alloc::string::String,
3054}
3055/// Response after deactivating a user.
3056#[derive(Clone, PartialEq, ::prost::Message)]
3057pub struct DeactivateUserResponse {
3058    /// The deactivated user (status: DEACTIVATED).
3059    #[prost(message, optional, tag="1")]
3060    pub user: ::core::option::Option<User>,
3061}
3062/// Request to reactivate a deactivated user.
3063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3064pub struct ReactivateUserRequest {
3065    /// ID of the user to reactivate.
3066    #[prost(string, tag="1")]
3067    pub user_id: ::prost::alloc::string::String,
3068}
3069/// Response after reactivating a user.
3070#[derive(Clone, PartialEq, ::prost::Message)]
3071pub struct ReactivateUserResponse {
3072    /// The reactivated user (status: INVITED).
3073    #[prost(message, optional, tag="1")]
3074    pub user: ::core::option::Option<User>,
3075}
3076/// Request to revoke an invitation for a user who has not yet registered.
3077#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3078pub struct RevokeInviteRequest {
3079    /// ID of the invited user to remove.
3080    /// Constraints: UUID format (36 characters).
3081    #[prost(string, tag="1")]
3082    pub user_id: ::prost::alloc::string::String,
3083}
3084/// Response after revoking an invitation. Empty on success.
3085#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3086pub struct RevokeInviteResponse {
3087}
3088/// Request to update a user's profile attributes.
3089#[derive(Clone, PartialEq, ::prost::Message)]
3090pub struct UpdateUserProfileRequest {
3091    /// ID of the user whose profile to update.
3092    /// Empty or matching the caller's own ID allows self-update without PERMISSION_MEMBERS_MANAGE.
3093    #[prost(string, tag="1")]
3094    pub user_id: ::prost::alloc::string::String,
3095    /// Profile attributes to set. All provided fields overwrite existing values.
3096    #[prost(message, optional, tag="2")]
3097    pub profile: ::core::option::Option<UserProfile>,
3098}
3099/// Response after updating a user's profile.
3100#[derive(Clone, PartialEq, ::prost::Message)]
3101pub struct UpdateUserProfileResponse {
3102    /// The updated user with the new profile.
3103    #[prost(message, optional, tag="1")]
3104    pub user: ::core::option::Option<User>,
3105}
3106/// Request to retrieve the caller's platform settings.
3107#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3108pub struct GetUserSettingsRequest {
3109}
3110/// Response containing the caller's platform settings.
3111#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3112pub struct GetUserSettingsResponse {
3113    /// Current settings. Fields at their default value indicate the platform default.
3114    #[prost(message, optional, tag="1")]
3115    pub settings: ::core::option::Option<UserSettings>,
3116}
3117/// Request to update the caller's platform settings.
3118#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3119pub struct UpdateUserSettingsRequest {
3120    /// Settings to update. Only fields with non-default (non-UNSPECIFIED) values
3121    /// are applied; default-valued fields are left unchanged.
3122    #[prost(message, optional, tag="1")]
3123    pub settings: ::core::option::Option<UserSettings>,
3124}
3125/// Response after updating the caller's platform settings.
3126#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3127pub struct UpdateUserSettingsResponse {
3128    /// The full settings after the update.
3129    #[prost(message, optional, tag="1")]
3130    pub settings: ::core::option::Option<UserSettings>,
3131}
3132/// Request to invite multiple users to the organization in a single call.
3133#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3134pub struct BulkInviteUsersRequest {
3135    /// Email addresses to invite.
3136    /// Constraints: Min 1, max 100 emails. Duplicates are deduplicated before processing.
3137    #[prost(string, repeated, tag="1")]
3138    pub emails: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3139    /// ID of the role to assign. Defaults to the organization's employee role if empty.
3140    #[prost(string, tag="2")]
3141    pub role_id: ::prost::alloc::string::String,
3142}
3143/// Per-email result within a bulk invite operation.
3144#[derive(Clone, PartialEq, ::prost::Message)]
3145pub struct BulkInviteResult {
3146    /// The email address that was processed.
3147    #[prost(string, tag="1")]
3148    pub email: ::prost::alloc::string::String,
3149    /// Whether the invitation succeeded.
3150    #[prost(bool, tag="2")]
3151    pub success: bool,
3152    /// Error message if the invitation failed (e.g. "user already exists").
3153    /// Empty on success.
3154    #[prost(string, tag="3")]
3155    pub error: ::prost::alloc::string::String,
3156    /// The created user. Only set on success.
3157    #[prost(message, optional, tag="4")]
3158    pub user: ::core::option::Option<User>,
3159}
3160/// Response after bulk inviting users.
3161#[derive(Clone, PartialEq, ::prost::Message)]
3162pub struct BulkInviteUsersResponse {
3163    /// Per-email results in the same order as the deduplicated input.
3164    #[prost(message, repeated, tag="1")]
3165    pub results: ::prost::alloc::vec::Vec<BulkInviteResult>,
3166    /// Number of users successfully invited.
3167    #[prost(int32, tag="2")]
3168    pub invited_count: i32,
3169    /// Number of emails that failed.
3170    #[prost(int32, tag="3")]
3171    pub failed_count: i32,
3172}
3173/// Request to confirm passkey enrollment after client-side WebAuthn registration.
3174/// The server verifies that the caller has at least one registered WebAuthn
3175/// credential before setting the enrollment attribute.
3176#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3177pub struct ConfirmPasskeyEnrollmentRequest {
3178}
3179/// Response after confirming passkey enrollment.
3180#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3181pub struct ConfirmPasskeyEnrollmentResponse {
3182    /// Whether enrollment was confirmed and the user attribute was updated.
3183    #[prost(bool, tag="1")]
3184    pub confirmed: bool,
3185}
3186/// Request to update a user's data governance region.
3187#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3188pub struct UpdateUserRegionRequest {
3189    /// ID of the user whose region to update. Required.
3190    #[prost(string, tag="1")]
3191    pub user_id: ::prost::alloc::string::String,
3192    /// New governance region, or empty to inherit from org default.
3193    /// Valid values: EU, LATAM, BR, APAC, US.
3194    #[prost(string, tag="2")]
3195    pub data_governance_region: ::prost::alloc::string::String,
3196}
3197/// Response after updating a user's governance region.
3198#[derive(Clone, PartialEq, ::prost::Message)]
3199pub struct UpdateUserRegionResponse {
3200    /// The updated user.
3201    #[prost(message, optional, tag="1")]
3202    pub user: ::core::option::Option<User>,
3203    /// Temporal workflow ID for the region migration, if a migration was triggered.
3204    /// Empty if the region didn't actually change.
3205    #[prost(string, tag="2")]
3206    pub migration_workflow_id: ::prost::alloc::string::String,
3207}
3208// ─── Messages ───────────────────────────────────────────────────────────────
3209
3210/// Maps an identity provider claim to a user profile field.
3211/// Used for automatic profile population when users authenticate via SSO/SAML.
3212#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3213pub struct SsoAttributeMapping {
3214    /// Claim name from the identity provider (e.g. "urn:oid:2.5.4.11", "given_name").
3215    /// Constraints: Max length 500 characters.
3216    #[prost(string, tag="1")]
3217    pub idp_claim: ::prost::alloc::string::String,
3218    /// Target UserProfile field name (e.g. "department", "first_name").
3219    /// For custom attributes, use "custom:" prefix (e.g. "custom:cost_center").
3220    /// Constraints: Max length 100 characters.
3221    #[prost(string, tag="2")]
3222    pub profile_field: ::prost::alloc::string::String,
3223}
3224/// An organization (tenant) in the Pidgr platform.
3225#[derive(Clone, PartialEq, ::prost::Message)]
3226pub struct Organization {
3227    /// Unique identifier for the organization.
3228    #[prost(string, tag="1")]
3229    pub id: ::prost::alloc::string::String,
3230    /// Organization display name.
3231    /// Constraints: Max length 200 characters.
3232    #[prost(string, tag="2")]
3233    pub name: ::prost::alloc::string::String,
3234    /// Default workflow used when campaigns don't specify one.
3235    #[prost(message, optional, tag="3")]
3236    pub default_workflow: ::core::option::Option<WorkflowDefinition>,
3237    /// Timestamp when the organization was created.
3238    #[prost(message, optional, tag="4")]
3239    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
3240    /// Industry vertical.
3241    #[prost(enumeration="Industry", tag="5")]
3242    pub industry: i32,
3243    /// Employee headcount range.
3244    #[prost(enumeration="CompanySize", tag="6")]
3245    pub company_size: i32,
3246    /// SSO identity provider claim-to-profile mappings.
3247    /// Empty when the organization does not use SSO.
3248    #[prost(message, repeated, tag="7")]
3249    pub sso_attribute_mappings: ::prost::alloc::vec::Vec<SsoAttributeMapping>,
3250    /// Default language for new users in this organization.
3251    /// Empty means no org default (users auto-detect from device/browser).
3252    /// Valid values: en, es, pt-BR, zh, ja.
3253    #[prost(string, tag="8")]
3254    pub default_locale: ::prost::alloc::string::String,
3255    /// Organization lifecycle type.
3256    #[prost(enumeration="OrgType", tag="9")]
3257    pub org_type: i32,
3258    /// Expiration time for sandbox organizations. Empty for standard orgs.
3259    #[prost(message, optional, tag="10")]
3260    pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
3261    /// Data governance framework (EU, LATAM, BR, APAC, US).
3262    /// Determines legal framework, DPA template, and Bedrock endpoint routing.
3263    #[prost(string, tag="11")]
3264    pub data_governance_region: ::prost::alloc::string::String,
3265    /// AWS region for content storage (resolved from data_governance_region).
3266    /// e.g., "eu-west-1", "us-east-1".
3267    #[prost(string, tag="12")]
3268    pub data_content_region: ::prost::alloc::string::String,
3269}
3270/// Request to create a new organization with an admin user.
3271/// Supports API key auth (service-to-service) and JWT auth (self-service onboarding).
3272#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3273pub struct CreateOrganizationRequest {
3274    /// Name for the new organization.
3275    /// Constraints: Max length 200 characters.
3276    #[prost(string, tag="1")]
3277    pub name: ::prost::alloc::string::String,
3278    /// Email address for the initial admin user.
3279    /// Only used with API key auth; ignored with JWT auth (email derived from identity provider subject).
3280    #[prost(string, tag="2")]
3281    pub admin_email: ::prost::alloc::string::String,
3282    /// Industry vertical for the organization.
3283    #[prost(enumeration="Industry", tag="3")]
3284    pub industry: i32,
3285    /// Employee headcount range.
3286    #[prost(enumeration="CompanySize", tag="4")]
3287    pub company_size: i32,
3288    /// Access code required during early access (JWT auth only). Ignored with API key auth.
3289    /// Format: PIDGR-XXXXXXXX (8 alphanumeric characters).
3290    #[prost(string, tag="5")]
3291    pub access_code: ::prost::alloc::string::String,
3292    /// Data governance framework. Defaults to "US" if omitted.
3293    /// Valid values: EU, LATAM, BR, APAC, US.
3294    #[prost(string, tag="6")]
3295    pub data_governance_region: ::prost::alloc::string::String,
3296}
3297/// Response after creating an organization.
3298#[derive(Clone, PartialEq, ::prost::Message)]
3299pub struct CreateOrganizationResponse {
3300    /// The newly created organization.
3301    #[prost(message, optional, tag="1")]
3302    pub organization: ::core::option::Option<Organization>,
3303    /// The admin user created for the organization.
3304    #[prost(message, optional, tag="2")]
3305    pub admin_user: ::core::option::Option<User>,
3306}
3307/// Request to retrieve the organization for the authenticated user.
3308#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3309pub struct GetOrganizationRequest {
3310}
3311/// Response containing the organization.
3312#[derive(Clone, PartialEq, ::prost::Message)]
3313pub struct GetOrganizationResponse {
3314    /// The organization the authenticated user belongs to.
3315    #[prost(message, optional, tag="1")]
3316    pub organization: ::core::option::Option<Organization>,
3317}
3318/// Request to update organization settings.
3319#[derive(Clone, PartialEq, ::prost::Message)]
3320pub struct UpdateOrganizationRequest {
3321    /// New organization name. Empty string leaves unchanged.
3322    /// Constraints: Max length 200 characters.
3323    #[prost(string, tag="1")]
3324    pub name: ::prost::alloc::string::String,
3325    /// New default workflow definition. Null leaves unchanged.
3326    #[prost(message, optional, tag="2")]
3327    pub default_workflow: ::core::option::Option<WorkflowDefinition>,
3328    /// New industry vertical. UNSPECIFIED leaves unchanged.
3329    #[prost(enumeration="Industry", tag="3")]
3330    pub industry: i32,
3331    /// New employee headcount range. UNSPECIFIED leaves unchanged.
3332    #[prost(enumeration="CompanySize", tag="4")]
3333    pub company_size: i32,
3334    /// New default language for new users. Empty string leaves unchanged.
3335    /// Valid values: en, es, pt-BR, zh, ja.
3336    #[prost(string, tag="5")]
3337    pub default_locale: ::prost::alloc::string::String,
3338}
3339/// Response after updating the organization.
3340#[derive(Clone, PartialEq, ::prost::Message)]
3341pub struct UpdateOrganizationResponse {
3342    /// The updated organization.
3343    #[prost(message, optional, tag="1")]
3344    pub organization: ::core::option::Option<Organization>,
3345}
3346/// Request to replace all SSO attribute mappings for the organization.
3347#[derive(Clone, PartialEq, ::prost::Message)]
3348pub struct UpdateSsoAttributeMappingsRequest {
3349    /// Complete list of SSO mappings (replaces all existing mappings).
3350    #[prost(message, repeated, tag="1")]
3351    pub sso_attribute_mappings: ::prost::alloc::vec::Vec<SsoAttributeMapping>,
3352}
3353/// Response after updating SSO attribute mappings.
3354#[derive(Clone, PartialEq, ::prost::Message)]
3355pub struct UpdateSsoAttributeMappingsResponse {
3356    /// The updated organization with the new SSO mappings.
3357    #[prost(message, optional, tag="1")]
3358    pub organization: ::core::option::Option<Organization>,
3359}
3360/// Request to rotate the analytics salt and optionally increase the bucket count.
3361#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3362pub struct RotateAnalyticsSaltRequest {
3363    /// New bucket count. Must be >= current bucket count. 0 means keep current.
3364    #[prost(int32, tag="1")]
3365    pub new_bucket_count: i32,
3366}
3367/// Response after rotating the analytics salt.
3368#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3369pub struct RotateAnalyticsSaltResponse {
3370    /// The new bucket count after rotation.
3371    #[prost(int32, tag="1")]
3372    pub bucket_count: i32,
3373}
3374/// Request to update the analytics epsilon (differential privacy parameter).
3375#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3376pub struct UpdateAnalyticsEpsilonRequest {
3377    /// New epsilon value. Must be in range \[0.5, 5.0\].
3378    #[prost(float, tag="1")]
3379    pub epsilon: f32,
3380}
3381/// Response after updating the analytics epsilon.
3382#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3383pub struct UpdateAnalyticsEpsilonResponse {
3384    /// The new epsilon value.
3385    #[prost(float, tag="1")]
3386    pub epsilon: f32,
3387}
3388/// Request to create a sandbox organization for testing.
3389#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3390pub struct CreateSandboxOrganizationRequest {
3391    /// Name for the sandbox organization.
3392    /// Constraints: Max length 200 characters.
3393    #[prost(string, tag="1")]
3394    pub name: ::prost::alloc::string::String,
3395    /// Required expiration time. Max 30 days from now (14 days if SCIM-enabled).
3396    #[prost(message, optional, tag="2")]
3397    pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
3398    /// Data governance framework. Defaults to "US" if omitted.
3399    /// Valid values: EU, LATAM, BR, APAC, US.
3400    #[prost(string, tag="3")]
3401    pub data_governance_region: ::prost::alloc::string::String,
3402}
3403/// Response after creating a sandbox organization.
3404#[derive(Clone, PartialEq, ::prost::Message)]
3405pub struct CreateSandboxOrganizationResponse {
3406    /// The newly created sandbox organization (org_type: SANDBOX).
3407    #[prost(message, optional, tag="1")]
3408    pub organization: ::core::option::Option<Organization>,
3409    /// The admin user created for the sandbox.
3410    #[prost(message, optional, tag="2")]
3411    pub admin_user: ::core::option::Option<User>,
3412}
3413/// Request to list all organizations the authenticated user belongs to.
3414/// No parameters — user identity is extracted from the JWT sub claim.
3415#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3416pub struct ListUserOrganizationsRequest {
3417}
3418/// Response containing all organizations the authenticated user belongs to.
3419#[derive(Clone, PartialEq, ::prost::Message)]
3420pub struct ListUserOrganizationsResponse {
3421    /// Organizations the user belongs to, ordered by created_at ascending.
3422    /// Excludes expired sandbox organizations.
3423    #[prost(message, repeated, tag="1")]
3424    pub organizations: ::prost::alloc::vec::Vec<Organization>,
3425}
3426// ─── Enums ───────────────────────────────────────────────────────────────────
3427
3428/// Industry vertical for an organization.
3429#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3430#[repr(i32)]
3431pub enum Industry {
3432    Unspecified = 0,
3433    Technology = 1,
3434    Finance = 2,
3435    Healthcare = 3,
3436    Education = 4,
3437    Retail = 5,
3438    Manufacturing = 6,
3439    Media = 7,
3440    Other = 8,
3441}
3442impl Industry {
3443    /// String value of the enum field names used in the ProtoBuf definition.
3444    ///
3445    /// The values are not transformed in any way and thus are considered stable
3446    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3447    pub fn as_str_name(&self) -> &'static str {
3448        match self {
3449            Self::Unspecified => "INDUSTRY_UNSPECIFIED",
3450            Self::Technology => "INDUSTRY_TECHNOLOGY",
3451            Self::Finance => "INDUSTRY_FINANCE",
3452            Self::Healthcare => "INDUSTRY_HEALTHCARE",
3453            Self::Education => "INDUSTRY_EDUCATION",
3454            Self::Retail => "INDUSTRY_RETAIL",
3455            Self::Manufacturing => "INDUSTRY_MANUFACTURING",
3456            Self::Media => "INDUSTRY_MEDIA",
3457            Self::Other => "INDUSTRY_OTHER",
3458        }
3459    }
3460    /// Creates an enum from field names used in the ProtoBuf definition.
3461    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3462        match value {
3463            "INDUSTRY_UNSPECIFIED" => Some(Self::Unspecified),
3464            "INDUSTRY_TECHNOLOGY" => Some(Self::Technology),
3465            "INDUSTRY_FINANCE" => Some(Self::Finance),
3466            "INDUSTRY_HEALTHCARE" => Some(Self::Healthcare),
3467            "INDUSTRY_EDUCATION" => Some(Self::Education),
3468            "INDUSTRY_RETAIL" => Some(Self::Retail),
3469            "INDUSTRY_MANUFACTURING" => Some(Self::Manufacturing),
3470            "INDUSTRY_MEDIA" => Some(Self::Media),
3471            "INDUSTRY_OTHER" => Some(Self::Other),
3472            _ => None,
3473        }
3474    }
3475}
3476/// Employee headcount range for an organization.
3477#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3478#[repr(i32)]
3479pub enum CompanySize {
3480    Unspecified = 0,
3481    CompanySize1200 = 1,
3482    CompanySize200500 = 2,
3483    CompanySize5001000 = 3,
3484    CompanySize10005000 = 4,
3485    CompanySize5000Plus = 5,
3486}
3487impl CompanySize {
3488    /// String value of the enum field names used in the ProtoBuf definition.
3489    ///
3490    /// The values are not transformed in any way and thus are considered stable
3491    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3492    pub fn as_str_name(&self) -> &'static str {
3493        match self {
3494            Self::Unspecified => "COMPANY_SIZE_UNSPECIFIED",
3495            Self::CompanySize1200 => "COMPANY_SIZE_1_200",
3496            Self::CompanySize200500 => "COMPANY_SIZE_200_500",
3497            Self::CompanySize5001000 => "COMPANY_SIZE_500_1000",
3498            Self::CompanySize10005000 => "COMPANY_SIZE_1000_5000",
3499            Self::CompanySize5000Plus => "COMPANY_SIZE_5000_PLUS",
3500        }
3501    }
3502    /// Creates an enum from field names used in the ProtoBuf definition.
3503    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3504        match value {
3505            "COMPANY_SIZE_UNSPECIFIED" => Some(Self::Unspecified),
3506            "COMPANY_SIZE_1_200" => Some(Self::CompanySize1200),
3507            "COMPANY_SIZE_200_500" => Some(Self::CompanySize200500),
3508            "COMPANY_SIZE_500_1000" => Some(Self::CompanySize5001000),
3509            "COMPANY_SIZE_1000_5000" => Some(Self::CompanySize10005000),
3510            "COMPANY_SIZE_5000_PLUS" => Some(Self::CompanySize5000Plus),
3511            _ => None,
3512        }
3513    }
3514}
3515/// Classification of an organization's lifecycle type.
3516#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3517#[repr(i32)]
3518pub enum OrgType {
3519    Unspecified = 0,
3520    Standard = 1,
3521    Sandbox = 2,
3522}
3523impl OrgType {
3524    /// String value of the enum field names used in the ProtoBuf definition.
3525    ///
3526    /// The values are not transformed in any way and thus are considered stable
3527    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3528    pub fn as_str_name(&self) -> &'static str {
3529        match self {
3530            Self::Unspecified => "ORG_TYPE_UNSPECIFIED",
3531            Self::Standard => "ORG_TYPE_STANDARD",
3532            Self::Sandbox => "ORG_TYPE_SANDBOX",
3533        }
3534    }
3535    /// Creates an enum from field names used in the ProtoBuf definition.
3536    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3537        match value {
3538            "ORG_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
3539            "ORG_TYPE_STANDARD" => Some(Self::Standard),
3540            "ORG_TYPE_SANDBOX" => Some(Self::Sandbox),
3541            _ => None,
3542        }
3543    }
3544}
3545// ─── Messages ───────────────────────────────────────────────────────────────
3546
3547/// Per-user rendering context containing variable substitutions.
3548#[derive(Clone, PartialEq, ::prost::Message)]
3549pub struct UserRenderContext {
3550    /// ID of the user being rendered for.
3551    #[prost(string, tag="1")]
3552    pub user_id: ::prost::alloc::string::String,
3553    /// Variable name-value pairs to substitute into the template.
3554    /// Constraints: Max 100 entries. Key max length 100 characters, value max length 10000 characters.
3555    #[prost(map="string, string", tag="2")]
3556    pub variables: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
3557}
3558/// Request to render a template for a batch of users.
3559#[derive(Clone, PartialEq, ::prost::Message)]
3560pub struct RenderBatchRequest {
3561    /// ID of the template to render.
3562    #[prost(string, tag="1")]
3563    pub template_id: ::prost::alloc::string::String,
3564    /// Version of the template to render.
3565    #[prost(int32, tag="2")]
3566    pub version: i32,
3567    /// Per-user rendering contexts with variable substitutions.
3568    /// Constraints: Max 10000 users per batch.
3569    #[prost(message, repeated, tag="3")]
3570    pub users: ::prost::alloc::vec::Vec<UserRenderContext>,
3571}
3572/// Streamed response for each user's rendered message.
3573/// One response is emitted per user in the batch.
3574#[derive(Clone, PartialEq, ::prost::Message)]
3575pub struct RenderBatchResponse {
3576    /// ID of the user this result is for.
3577    #[prost(string, tag="1")]
3578    pub user_id: ::prost::alloc::string::String,
3579    /// The rendered message (set on success).
3580    #[prost(message, optional, tag="2")]
3581    pub message: ::core::option::Option<Message>,
3582    /// Error message if rendering failed for this user (empty on success).
3583    #[prost(string, tag="3")]
3584    pub error: ::prost::alloc::string::String,
3585}
3586// ─── Messages ───────────────────────────────────────────────────────────────
3587
3588/// A session recording summary from the analytics provider.
3589/// Anonymous: no user identifiers are included.
3590#[derive(Clone, PartialEq, ::prost::Message)]
3591pub struct SessionRecording {
3592    /// Recording ID from the analytics provider.
3593    #[prost(string, tag="1")]
3594    pub id: ::prost::alloc::string::String,
3595    /// Timestamp when the recording started.
3596    #[prost(message, optional, tag="2")]
3597    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
3598    /// Timestamp when the recording ended.
3599    #[prost(message, optional, tag="3")]
3600    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
3601    /// Duration of the recording in seconds.
3602    #[prost(int32, tag="4")]
3603    pub duration_seconds: i32,
3604    /// Activity score (0.0–1.0).
3605    #[prost(float, tag="5")]
3606    pub activity_score: f32,
3607}
3608/// Request to list session recordings.
3609#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3610pub struct ListSessionRecordingsRequest {
3611    /// Optional: filter recordings by campaign ID (mapped to analytics property filter).
3612    /// Constraints: UUID format (36 characters).
3613    #[prost(string, tag="1")]
3614    pub campaign_id: ::prost::alloc::string::String,
3615    /// Optional: start of the time range filter (inclusive).
3616    #[prost(message, optional, tag="2")]
3617    pub date_from: ::core::option::Option<::prost_types::Timestamp>,
3618    /// Optional: end of the time range filter (inclusive).
3619    #[prost(message, optional, tag="3")]
3620    pub date_to: ::core::option::Option<::prost_types::Timestamp>,
3621    /// Pagination parameters.
3622    #[prost(message, optional, tag="4")]
3623    pub pagination: ::core::option::Option<Pagination>,
3624}
3625/// Response containing a page of session recordings.
3626#[derive(Clone, PartialEq, ::prost::Message)]
3627pub struct ListSessionRecordingsResponse {
3628    /// List of session recordings in this page.
3629    #[prost(message, repeated, tag="1")]
3630    pub recordings: ::prost::alloc::vec::Vec<SessionRecording>,
3631    /// Pagination metadata for fetching subsequent pages.
3632    #[prost(message, optional, tag="2")]
3633    pub pagination_meta: ::core::option::Option<PaginationMeta>,
3634}
3635/// Request to fetch rrweb snapshot events for a recording.
3636#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3637pub struct GetSessionSnapshotsRequest {
3638    /// Recording ID from the analytics provider.
3639    /// Constraints: Max length 200 characters.
3640    #[prost(string, tag="1")]
3641    pub recording_id: ::prost::alloc::string::String,
3642}
3643/// Response containing rrweb snapshot events.
3644#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3645pub struct GetSessionSnapshotsResponse {
3646    /// JSON-encoded array of rrweb eventWithTime objects.
3647    /// Clients parse this JSON to feed into rrweb-player.
3648    #[prost(string, tag="1")]
3649    pub snapshot_data: ::prost::alloc::string::String,
3650}
3651// ─── Messages ───────────────────────────────────────────────────────────────
3652
3653/// Request to list all roles in the caller's organization.
3654#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3655pub struct ListRolesRequest {
3656}
3657/// Response containing the organization's roles.
3658#[derive(Clone, PartialEq, ::prost::Message)]
3659pub struct ListRolesResponse {
3660    /// All roles in the organization, including their permission sets.
3661    #[prost(message, repeated, tag="1")]
3662    pub roles: ::prost::alloc::vec::Vec<Role>,
3663}
3664/// Request to create a new role in the caller's organization.
3665#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3666pub struct CreateRoleRequest {
3667    /// Display name for the role (e.g. "Team Lead"). Required.
3668    /// A slug is auto-generated from the name.
3669    #[prost(string, tag="1")]
3670    pub name: ::prost::alloc::string::String,
3671    /// Initial permission set for the role.
3672    /// PERMISSION_UNSPECIFIED values are rejected.
3673    #[prost(enumeration="Permission", repeated, tag="2")]
3674    pub permissions: ::prost::alloc::vec::Vec<i32>,
3675}
3676/// Response after creating a role.
3677#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3678pub struct CreateRoleResponse {
3679    /// The newly created role with its generated slug and permission set.
3680    #[prost(message, optional, tag="1")]
3681    pub role: ::core::option::Option<Role>,
3682}
3683/// Request to update a role's name and/or permissions.
3684#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3685pub struct UpdateRoleRequest {
3686    /// ID of the role to update. Required.
3687    #[prost(string, tag="1")]
3688    pub role_id: ::prost::alloc::string::String,
3689    /// New display name. If empty, the name is not changed.
3690    #[prost(string, tag="2")]
3691    pub name: ::prost::alloc::string::String,
3692    /// New permission set (replaces existing permissions entirely).
3693    /// If empty, permissions are not changed.
3694    /// PERMISSION_UNSPECIFIED values are rejected.
3695    #[prost(enumeration="Permission", repeated, tag="3")]
3696    pub permissions: ::prost::alloc::vec::Vec<i32>,
3697}
3698/// Response after updating a role.
3699#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3700pub struct UpdateRoleResponse {
3701    /// The updated role.
3702    #[prost(message, optional, tag="1")]
3703    pub role: ::core::option::Option<Role>,
3704}
3705/// Request to delete a role.
3706#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3707pub struct DeleteRoleRequest {
3708    /// ID of the role to delete. Required.
3709    #[prost(string, tag="1")]
3710    pub role_id: ::prost::alloc::string::String,
3711}
3712/// Response after deleting a role.
3713#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3714pub struct DeleteRoleResponse {
3715}
3716// ─── Messages ───────────────────────────────────────────────────────────────
3717
3718/// Custom SAML attribute name overrides for identity providers that use
3719/// non-standard attribute names. When provided, these override the
3720/// auto-detected values from the metadata URL host.
3721#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3722pub struct SamlAttributeNames {
3723    /// SAML attribute name for the user's email address.
3724    #[prost(string, tag="1")]
3725    pub email: ::prost::alloc::string::String,
3726    /// SAML attribute name for the user's first name.
3727    #[prost(string, tag="2")]
3728    pub given_name: ::prost::alloc::string::String,
3729    /// SAML attribute name for the user's last name.
3730    #[prost(string, tag="3")]
3731    pub family_name: ::prost::alloc::string::String,
3732}
3733/// An SSO identity provider configured for an organization.
3734#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3735pub struct SsoProvider {
3736    /// Unique identifier for the provider.
3737    #[prost(string, tag="1")]
3738    pub id: ::prost::alloc::string::String,
3739    /// Email domain that triggers this SSO provider (e.g. "acme.com").
3740    /// Constraints: Max length 253 characters (RFC 1035).
3741    #[prost(string, tag="2")]
3742    pub domain: ::prost::alloc::string::String,
3743    /// Type of identity provider.
3744    #[prost(enumeration="SsoProviderType", tag="3")]
3745    pub r#type: i32,
3746    /// SAML metadata URL or OIDC discovery URL.
3747    /// Constraints: Max length 2048 characters. HTTPS required.
3748    #[prost(string, tag="4")]
3749    pub metadata_url: ::prost::alloc::string::String,
3750    /// Name of the identity provider (used for signInWithRedirect).
3751    /// Set by the API when the IdP is created.
3752    #[prost(string, tag="5")]
3753    pub idp_provider_name: ::prost::alloc::string::String,
3754    /// Timestamp when the provider was created.
3755    #[prost(message, optional, tag="6")]
3756    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
3757    /// Timestamp when the provider was last updated.
3758    #[prost(message, optional, tag="7")]
3759    pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
3760    /// Optional custom SAML attribute name overrides.
3761    #[prost(message, optional, tag="8")]
3762    pub attribute_mapping: ::core::option::Option<SamlAttributeNames>,
3763}
3764/// Request to check if an email domain has SSO configured.
3765/// This RPC is pre-authentication — no JWT required.
3766#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3767pub struct CheckSsoByDomainRequest {
3768    /// Email address to check. The domain part is extracted.
3769    /// Constraints: Max length 254 characters (RFC 5321).
3770    #[prost(string, tag="1")]
3771    pub email: ::prost::alloc::string::String,
3772}
3773/// Response for SSO domain check.
3774#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3775pub struct CheckSsoByDomainResponse {
3776    /// Whether SSO is enabled for the email's domain.
3777    #[prost(bool, tag="1")]
3778    pub sso_enabled: bool,
3779    /// Identity provider name for signInWithRedirect.
3780    /// Empty if sso_enabled is false.
3781    #[prost(string, tag="2")]
3782    pub provider_name: ::prost::alloc::string::String,
3783}
3784/// Request to create an SSO provider for the organization.
3785#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3786pub struct CreateSsoProviderRequest {
3787    /// Email domain to associate (e.g. "acme.com").
3788    /// Constraints: Max length 253 characters (RFC 1035).
3789    #[prost(string, tag="1")]
3790    pub domain: ::prost::alloc::string::String,
3791    /// Type of identity provider.
3792    #[prost(enumeration="SsoProviderType", tag="2")]
3793    pub r#type: i32,
3794    /// SAML metadata URL or OIDC discovery URL.
3795    /// Constraints: Max length 2048 characters. HTTPS required.
3796    #[prost(string, tag="3")]
3797    pub metadata_url: ::prost::alloc::string::String,
3798    /// Optional custom SAML attribute name overrides.
3799    /// When omitted, attribute names are auto-detected from the metadata URL.
3800    #[prost(message, optional, tag="4")]
3801    pub attribute_mapping: ::core::option::Option<SamlAttributeNames>,
3802}
3803/// Response after creating an SSO provider.
3804#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3805pub struct CreateSsoProviderResponse {
3806    /// The newly created SSO provider.
3807    #[prost(message, optional, tag="1")]
3808    pub provider: ::core::option::Option<SsoProvider>,
3809}
3810/// Request to get the SSO provider for the organization.
3811/// Returns the provider if one is configured, or empty if not.
3812#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3813pub struct GetSsoProviderRequest {
3814}
3815/// Response containing the organization's SSO provider.
3816#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3817pub struct GetSsoProviderResponse {
3818    /// The organization's SSO provider, or null if not configured.
3819    #[prost(message, optional, tag="1")]
3820    pub provider: ::core::option::Option<SsoProvider>,
3821}
3822/// Request to delete the organization's SSO provider.
3823#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3824pub struct DeleteSsoProviderRequest {
3825    /// ID of the provider to delete.
3826    #[prost(string, tag="1")]
3827    pub provider_id: ::prost::alloc::string::String,
3828}
3829/// Response after deleting an SSO provider.
3830#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3831pub struct DeleteSsoProviderResponse {
3832}
3833// ─── Enums ──────────────────────────────────────────────────────────────────
3834
3835/// Type of SSO identity provider.
3836#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3837#[repr(i32)]
3838pub enum SsoProviderType {
3839    /// Default value; not a valid type.
3840    Unspecified = 0,
3841    /// SAML 2.0 identity provider (e.g. Okta, Azure AD).
3842    Saml = 1,
3843    /// OpenID Connect identity provider (e.g. Google Workspace, Auth0).
3844    Oidc = 2,
3845}
3846impl SsoProviderType {
3847    /// String value of the enum field names used in the ProtoBuf definition.
3848    ///
3849    /// The values are not transformed in any way and thus are considered stable
3850    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3851    pub fn as_str_name(&self) -> &'static str {
3852        match self {
3853            Self::Unspecified => "SSO_PROVIDER_TYPE_UNSPECIFIED",
3854            Self::Saml => "SSO_PROVIDER_TYPE_SAML",
3855            Self::Oidc => "SSO_PROVIDER_TYPE_OIDC",
3856        }
3857    }
3858    /// Creates an enum from field names used in the ProtoBuf definition.
3859    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3860        match value {
3861            "SSO_PROVIDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
3862            "SSO_PROVIDER_TYPE_SAML" => Some(Self::Saml),
3863            "SSO_PROVIDER_TYPE_OIDC" => Some(Self::Oidc),
3864            _ => None,
3865        }
3866    }
3867}
3868// ─── Messages ───────────────────────────────────────────────────────────────
3869
3870/// An organizational unit within an organization (e.g. department, division).
3871/// Teams represent the organizational structure and can serve as sender identity
3872/// in campaigns.
3873#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3874pub struct Team {
3875    /// Unique identifier for the team.
3876    #[prost(string, tag="1")]
3877    pub id: ::prost::alloc::string::String,
3878    /// Human-readable display name (unique within the organization).
3879    /// Constraints: Max length 200 characters.
3880    #[prost(string, tag="2")]
3881    pub name: ::prost::alloc::string::String,
3882    /// Optional description of the team's purpose.
3883    /// Constraints: Max length 1000 characters.
3884    #[prost(string, tag="3")]
3885    pub description: ::prost::alloc::string::String,
3886    /// Number of users currently in the team.
3887    #[prost(int32, tag="4")]
3888    pub member_count: i32,
3889    /// Timestamp when the team was created.
3890    #[prost(message, optional, tag="5")]
3891    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
3892    /// Timestamp when the team was last updated.
3893    #[prost(message, optional, tag="6")]
3894    pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
3895    /// Whether this is the organization's default team (cannot be deleted or renamed).
3896    #[prost(bool, tag="7")]
3897    pub is_default: bool,
3898    /// ID of the user who created this team. Empty for system-seeded defaults.
3899    #[prost(string, tag="8")]
3900    pub created_by: ::prost::alloc::string::String,
3901}
3902/// Request to create a new team.
3903#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3904pub struct CreateTeamRequest {
3905    /// Display name for the team. Required.
3906    /// Constraints: Max length 200 characters.
3907    #[prost(string, tag="1")]
3908    pub name: ::prost::alloc::string::String,
3909    /// Optional description.
3910    /// Constraints: Max length 1000 characters.
3911    #[prost(string, tag="2")]
3912    pub description: ::prost::alloc::string::String,
3913}
3914/// Response after creating a team.
3915#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3916pub struct CreateTeamResponse {
3917    /// The newly created team.
3918    #[prost(message, optional, tag="1")]
3919    pub team: ::core::option::Option<Team>,
3920}
3921/// Request to retrieve a team by ID.
3922#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3923pub struct GetTeamRequest {
3924    /// ID of the team to retrieve. Required.
3925    #[prost(string, tag="1")]
3926    pub team_id: ::prost::alloc::string::String,
3927}
3928/// Response containing the requested team.
3929#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3930pub struct GetTeamResponse {
3931    /// The requested team.
3932    #[prost(message, optional, tag="1")]
3933    pub team: ::core::option::Option<Team>,
3934}
3935/// Request to list teams in the organization with pagination.
3936#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3937pub struct ListTeamsRequest {
3938    /// Pagination parameters.
3939    #[prost(message, optional, tag="1")]
3940    pub pagination: ::core::option::Option<Pagination>,
3941}
3942/// Response containing a page of teams.
3943#[derive(Clone, PartialEq, ::prost::Message)]
3944pub struct ListTeamsResponse {
3945    /// Teams in this page.
3946    #[prost(message, repeated, tag="1")]
3947    pub teams: ::prost::alloc::vec::Vec<Team>,
3948    /// Pagination metadata for fetching subsequent pages.
3949    #[prost(message, optional, tag="2")]
3950    pub pagination_meta: ::core::option::Option<PaginationMeta>,
3951}
3952/// Request to update a team's name and/or description.
3953#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3954pub struct UpdateTeamRequest {
3955    /// ID of the team to update. Required.
3956    #[prost(string, tag="1")]
3957    pub team_id: ::prost::alloc::string::String,
3958    /// New display name. If empty, the name is not changed.
3959    /// Default teams cannot be renamed.
3960    /// Constraints: Max length 200 characters.
3961    #[prost(string, tag="2")]
3962    pub name: ::prost::alloc::string::String,
3963    /// New description. If empty, the description is not changed.
3964    /// Constraints: Max length 1000 characters.
3965    #[prost(string, tag="3")]
3966    pub description: ::prost::alloc::string::String,
3967}
3968/// Response after updating a team.
3969#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3970pub struct UpdateTeamResponse {
3971    /// The updated team.
3972    #[prost(message, optional, tag="1")]
3973    pub team: ::core::option::Option<Team>,
3974}
3975/// Request to delete a team.
3976#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3977pub struct DeleteTeamRequest {
3978    /// ID of the team to delete. Required.
3979    /// Default teams cannot be deleted.
3980    #[prost(string, tag="1")]
3981    pub team_id: ::prost::alloc::string::String,
3982}
3983/// Response after deleting a team.
3984#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3985pub struct DeleteTeamResponse {
3986}
3987/// Request to add users to a team.
3988#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3989pub struct AddTeamMembersRequest {
3990    /// ID of the team to add members to. Required.
3991    #[prost(string, tag="1")]
3992    pub team_id: ::prost::alloc::string::String,
3993    /// IDs of users to add. Must belong to the same organization.
3994    /// Adding an existing member is a no-op (idempotent).
3995    /// Constraints: Max 100 user IDs per request.
3996    #[prost(string, repeated, tag="2")]
3997    pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3998}
3999/// Response after adding team members.
4000#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4001pub struct AddTeamMembersResponse {
4002    /// The team with updated member_count.
4003    #[prost(message, optional, tag="1")]
4004    pub team: ::core::option::Option<Team>,
4005}
4006/// Request to remove users from a team.
4007#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4008pub struct RemoveTeamMembersRequest {
4009    /// ID of the team to remove members from. Required.
4010    #[prost(string, tag="1")]
4011    pub team_id: ::prost::alloc::string::String,
4012    /// IDs of users to remove. Removing a non-member is a no-op (idempotent).
4013    /// Constraints: Max 100 user IDs per request.
4014    #[prost(string, repeated, tag="2")]
4015    pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
4016}
4017/// Response after removing team members.
4018#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4019pub struct RemoveTeamMembersResponse {
4020    /// The team with updated member_count.
4021    #[prost(message, optional, tag="1")]
4022    pub team: ::core::option::Option<Team>,
4023}
4024/// Request to list members of a team with pagination.
4025#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4026pub struct ListTeamMembersRequest {
4027    /// ID of the team whose members to list. Required.
4028    #[prost(string, tag="1")]
4029    pub team_id: ::prost::alloc::string::String,
4030    /// Pagination parameters.
4031    #[prost(message, optional, tag="2")]
4032    pub pagination: ::core::option::Option<Pagination>,
4033}
4034/// Response containing a page of team members.
4035#[derive(Clone, PartialEq, ::prost::Message)]
4036pub struct ListTeamMembersResponse {
4037    /// Users in this page.
4038    #[prost(message, repeated, tag="1")]
4039    pub users: ::prost::alloc::vec::Vec<User>,
4040    /// Pagination metadata for fetching subsequent pages.
4041    #[prost(message, optional, tag="2")]
4042    pub pagination_meta: ::core::option::Option<PaginationMeta>,
4043}
4044// ─── Messages ───────────────────────────────────────────────────────────────
4045
4046/// A variable placeholder within a template that gets substituted during rendering.
4047#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4048pub struct TemplateVariable {
4049    /// Variable name used in the template body (e.g. "employee_name").
4050    /// Constraints: Max length 100 characters.
4051    #[prost(string, tag="1")]
4052    pub name: ::prost::alloc::string::String,
4053    /// Human-readable description of what this variable represents.
4054    /// Constraints: Max length 500 characters.
4055    #[prost(string, tag="2")]
4056    pub description: ::prost::alloc::string::String,
4057    /// Whether this variable must be provided during rendering.
4058    #[prost(bool, tag="3")]
4059    pub required: bool,
4060    /// Where this variable's value comes from (profile attribute or campaign config).
4061    #[prost(enumeration="TemplateVariableSource", tag="4")]
4062    pub source: i32,
4063    /// Fallback value used when the source does not provide a value.
4064    /// Constraints: Max length 1000 characters.
4065    #[prost(string, tag="5")]
4066    pub default_value: ::prost::alloc::string::String,
4067    /// When true, this variable's rendered value is masked in session replay
4068    /// and heatmap screenshots. Org admin controls per variable.
4069    #[prost(bool, tag="6")]
4070    pub pii: bool,
4071}
4072/// A versioned message template with variable placeholders.
4073/// Templates are append-only — updates create new versions.
4074#[derive(Clone, PartialEq, ::prost::Message)]
4075pub struct Template {
4076    /// Unique identifier for the template.
4077    #[prost(string, tag="1")]
4078    pub id: ::prost::alloc::string::String,
4079    /// Human-readable template name (admin-facing label).
4080    /// Constraints: Max length 200 characters.
4081    #[prost(string, tag="2")]
4082    pub name: ::prost::alloc::string::String,
4083    /// Template body with {{variable}} placeholders for substitution.
4084    /// Constraints: Max length 50000 characters.
4085    #[prost(string, tag="3")]
4086    pub body: ::prost::alloc::string::String,
4087    /// Variables that can be substituted into the template body.
4088    #[prost(message, repeated, tag="4")]
4089    pub variables: ::prost::alloc::vec::Vec<TemplateVariable>,
4090    /// Version number (auto-incremented on each update).
4091    #[prost(int32, tag="5")]
4092    pub version: i32,
4093    /// Timestamp when this version was created.
4094    #[prost(message, optional, tag="6")]
4095    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
4096    /// Timestamp of the most recent update (same as created_at for the latest version).
4097    #[prost(message, optional, tag="7")]
4098    pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
4099    /// User-facing title shown as the message subject to recipients.
4100    /// Serves as the default title; campaigns can override it.
4101    /// Constraints: Max length 200 characters.
4102    #[prost(string, tag="8")]
4103    pub title: ::prost::alloc::string::String,
4104    /// Content format of this template (markdown, rich, HTML).
4105    /// UNSPECIFIED is treated as MARKDOWN for backward compatibility.
4106    #[prost(enumeration="TemplateType", tag="9")]
4107    pub r#type: i32,
4108    /// Language of the template body content (e.g., "en", "es", "ja").
4109    /// Defaults to the org's default_locale, falling back to "en".
4110    /// Translations are created as locale variants of this source.
4111    #[prost(string, tag="10")]
4112    pub source_locale: ::prost::alloc::string::String,
4113}
4114/// A locale-specific translation of a template's title and body.
4115/// Translations are created per template version and go through a review workflow.
4116#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4117pub struct TemplateTranslation {
4118    /// Unique identifier for this translation.
4119    #[prost(string, tag="1")]
4120    pub id: ::prost::alloc::string::String,
4121    /// ID of the source template.
4122    #[prost(string, tag="2")]
4123    pub template_id: ::prost::alloc::string::String,
4124    /// Version of the source template this translation is for.
4125    #[prost(int32, tag="3")]
4126    pub version: i32,
4127    /// Target locale (e.g., "es", "pt-BR", "zh", "ja").
4128    #[prost(string, tag="4")]
4129    pub locale: ::prost::alloc::string::String,
4130    /// Translated title.
4131    /// Constraints: Max length 200 characters.
4132    #[prost(string, tag="5")]
4133    pub title: ::prost::alloc::string::String,
4134    /// Translated body content with {{variable}} placeholders preserved.
4135    /// Constraints: Max length 50000 characters.
4136    #[prost(string, tag="6")]
4137    pub body: ::prost::alloc::string::String,
4138    /// Current review status.
4139    #[prost(enumeration="TranslationStatus", tag="7")]
4140    pub status: i32,
4141    /// Who created this translation ("ai:bedrock", "ai:deepl", or user UUID).
4142    #[prost(string, tag="8")]
4143    pub translated_by: ::prost::alloc::string::String,
4144    /// User who approved the translation. Empty until approved.
4145    #[prost(string, tag="9")]
4146    pub reviewed_by: ::prost::alloc::string::String,
4147    /// When the translation was approved.
4148    #[prost(message, optional, tag="10")]
4149    pub reviewed_at: ::core::option::Option<::prost_types::Timestamp>,
4150    /// When the translation was created.
4151    #[prost(message, optional, tag="11")]
4152    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
4153}
4154/// Request to create a new template.
4155#[derive(Clone, PartialEq, ::prost::Message)]
4156pub struct CreateTemplateRequest {
4157    /// Human-readable template name (admin-facing label).
4158    /// Constraints: Max length 200 characters.
4159    #[prost(string, tag="1")]
4160    pub name: ::prost::alloc::string::String,
4161    /// Template body with {{variable}} placeholders.
4162    /// Constraints: Max length 50000 characters.
4163    #[prost(string, tag="2")]
4164    pub body: ::prost::alloc::string::String,
4165    /// Variables available for substitution in the body.
4166    #[prost(message, repeated, tag="3")]
4167    pub variables: ::prost::alloc::vec::Vec<TemplateVariable>,
4168    /// User-facing title shown as the message subject to recipients.
4169    /// Constraints: Max length 200 characters.
4170    #[prost(string, tag="4")]
4171    pub title: ::prost::alloc::string::String,
4172    /// Content format of the template. Defaults to MARKDOWN if unspecified.
4173    #[prost(enumeration="TemplateType", tag="5")]
4174    pub r#type: i32,
4175    /// Language of the template body content. Defaults to org's default_locale.
4176    /// Valid values: en, es, pt-BR, zh, ja.
4177    #[prost(string, tag="6")]
4178    pub source_locale: ::prost::alloc::string::String,
4179}
4180/// Response after creating a template.
4181#[derive(Clone, PartialEq, ::prost::Message)]
4182pub struct CreateTemplateResponse {
4183    /// The newly created template (version 1).
4184    #[prost(message, optional, tag="1")]
4185    pub template: ::core::option::Option<Template>,
4186}
4187/// Request to update a template, creating a new version.
4188#[derive(Clone, PartialEq, ::prost::Message)]
4189pub struct UpdateTemplateRequest {
4190    /// ID of the template to update.
4191    #[prost(string, tag="1")]
4192    pub template_id: ::prost::alloc::string::String,
4193    /// New template body with {{variable}} placeholders.
4194    /// Constraints: Max length 50000 characters.
4195    #[prost(string, tag="2")]
4196    pub body: ::prost::alloc::string::String,
4197    /// Updated variables for substitution.
4198    #[prost(message, repeated, tag="3")]
4199    pub variables: ::prost::alloc::vec::Vec<TemplateVariable>,
4200}
4201/// Response after updating a template.
4202#[derive(Clone, PartialEq, ::prost::Message)]
4203pub struct UpdateTemplateResponse {
4204    /// The updated template with incremented version number.
4205    #[prost(message, optional, tag="1")]
4206    pub template: ::core::option::Option<Template>,
4207}
4208/// Request to retrieve a specific template version.
4209#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4210pub struct GetTemplateRequest {
4211    /// ID of the template to retrieve.
4212    #[prost(string, tag="1")]
4213    pub template_id: ::prost::alloc::string::String,
4214    /// Version to retrieve. 0 returns the latest version.
4215    #[prost(int32, tag="2")]
4216    pub version: i32,
4217}
4218/// Response containing the requested template.
4219#[derive(Clone, PartialEq, ::prost::Message)]
4220pub struct GetTemplateResponse {
4221    /// The requested template.
4222    #[prost(message, optional, tag="1")]
4223    pub template: ::core::option::Option<Template>,
4224}
4225/// Request to list templates with pagination.
4226#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4227pub struct ListTemplatesRequest {
4228    /// Pagination parameters.
4229    #[prost(message, optional, tag="1")]
4230    pub pagination: ::core::option::Option<Pagination>,
4231    /// Filter by template type. UNSPECIFIED returns all templates.
4232    #[prost(enumeration="TemplateType", tag="2")]
4233    pub r#type: i32,
4234}
4235/// Response containing a page of templates.
4236#[derive(Clone, PartialEq, ::prost::Message)]
4237pub struct ListTemplatesResponse {
4238    /// List of templates in this page (latest version of each).
4239    #[prost(message, repeated, tag="1")]
4240    pub templates: ::prost::alloc::vec::Vec<Template>,
4241    /// Pagination metadata for fetching subsequent pages.
4242    #[prost(message, optional, tag="2")]
4243    pub pagination_meta: ::core::option::Option<PaginationMeta>,
4244}
4245/// Request to create a translation for a template.
4246#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4247pub struct CreateTemplateTranslationRequest {
4248    /// ID of the template to translate.
4249    #[prost(string, tag="1")]
4250    pub template_id: ::prost::alloc::string::String,
4251    /// Version of the template to translate.
4252    #[prost(int32, tag="2")]
4253    pub version: i32,
4254    /// Target locale.
4255    #[prost(string, tag="3")]
4256    pub locale: ::prost::alloc::string::String,
4257    /// Translated title.
4258    #[prost(string, tag="4")]
4259    pub title: ::prost::alloc::string::String,
4260    /// Translated body content.
4261    #[prost(string, tag="5")]
4262    pub body: ::prost::alloc::string::String,
4263    /// Who created this translation ("ai:bedrock" or user UUID).
4264    #[prost(string, tag="6")]
4265    pub translated_by: ::prost::alloc::string::String,
4266    /// Initial status (typically DRAFT or AI_TRANSLATED).
4267    #[prost(enumeration="TranslationStatus", tag="7")]
4268    pub status: i32,
4269}
4270/// Response after creating a template translation.
4271#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4272pub struct CreateTemplateTranslationResponse {
4273    /// The created translation.
4274    #[prost(message, optional, tag="1")]
4275    pub translation: ::core::option::Option<TemplateTranslation>,
4276}
4277/// Request to update an existing template translation.
4278#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4279pub struct UpdateTemplateTranslationRequest {
4280    /// ID of the translation to update.
4281    #[prost(string, tag="1")]
4282    pub translation_id: ::prost::alloc::string::String,
4283    /// Updated title. Empty leaves unchanged.
4284    #[prost(string, tag="2")]
4285    pub title: ::prost::alloc::string::String,
4286    /// Updated body. Empty leaves unchanged.
4287    #[prost(string, tag="3")]
4288    pub body: ::prost::alloc::string::String,
4289    /// Updated status.
4290    #[prost(enumeration="TranslationStatus", tag="4")]
4291    pub status: i32,
4292}
4293/// Response after updating a template translation.
4294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4295pub struct UpdateTemplateTranslationResponse {
4296    /// The updated translation.
4297    #[prost(message, optional, tag="1")]
4298    pub translation: ::core::option::Option<TemplateTranslation>,
4299}
4300/// Request to list translations for a template version.
4301#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4302pub struct ListTemplateTranslationsRequest {
4303    /// ID of the template.
4304    #[prost(string, tag="1")]
4305    pub template_id: ::prost::alloc::string::String,
4306    /// Version of the template. 0 returns translations for the latest version.
4307    #[prost(int32, tag="2")]
4308    pub version: i32,
4309}
4310/// Response containing all translations for a template version.
4311#[derive(Clone, PartialEq, ::prost::Message)]
4312pub struct ListTemplateTranslationsResponse {
4313    /// Translations for the requested template version.
4314    #[prost(message, repeated, tag="1")]
4315    pub translations: ::prost::alloc::vec::Vec<TemplateTranslation>,
4316}
4317/// Request to approve a template translation.
4318#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4319pub struct ApproveTemplateTranslationRequest {
4320    /// ID of the translation to approve.
4321    #[prost(string, tag="1")]
4322    pub translation_id: ::prost::alloc::string::String,
4323}
4324/// Response after approving a template translation.
4325#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4326pub struct ApproveTemplateTranslationResponse {
4327    /// The approved translation (status: APPROVED, reviewed_by and reviewed_at set).
4328    #[prost(message, optional, tag="1")]
4329    pub translation: ::core::option::Option<TemplateTranslation>,
4330}
4331// ─── Enums ──────────────────────────────────────────────────────────────────
4332
4333/// Content format of a template, determining which editor and renderer to use.
4334#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4335#[repr(i32)]
4336pub enum TemplateType {
4337    /// Default value; treated as MARKDOWN for backward compatibility.
4338    Unspecified = 0,
4339    /// Markdown with {{variable}} placeholders.
4340    Markdown = 1,
4341    /// Rich text format (reserved for future use).
4342    Rich = 2,
4343    /// Raw HTML format (reserved for future use).
4344    Html = 3,
4345}
4346impl TemplateType {
4347    /// String value of the enum field names used in the ProtoBuf definition.
4348    ///
4349    /// The values are not transformed in any way and thus are considered stable
4350    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4351    pub fn as_str_name(&self) -> &'static str {
4352        match self {
4353            Self::Unspecified => "TEMPLATE_TYPE_UNSPECIFIED",
4354            Self::Markdown => "TEMPLATE_TYPE_MARKDOWN",
4355            Self::Rich => "TEMPLATE_TYPE_RICH",
4356            Self::Html => "TEMPLATE_TYPE_HTML",
4357        }
4358    }
4359    /// Creates an enum from field names used in the ProtoBuf definition.
4360    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4361        match value {
4362            "TEMPLATE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
4363            "TEMPLATE_TYPE_MARKDOWN" => Some(Self::Markdown),
4364            "TEMPLATE_TYPE_RICH" => Some(Self::Rich),
4365            "TEMPLATE_TYPE_HTML" => Some(Self::Html),
4366            _ => None,
4367        }
4368    }
4369}
4370/// Source from which a template variable's value is resolved at render time.
4371#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4372#[repr(i32)]
4373pub enum TemplateVariableSource {
4374    /// Default value; treated as CUSTOM for backward compatibility.
4375    Unspecified = 0,
4376    /// Auto-resolved from the target user's profile attributes.
4377    Profile = 1,
4378    /// Provided manually in the campaign or workflow step configuration.
4379    Custom = 2,
4380}
4381impl TemplateVariableSource {
4382    /// String value of the enum field names used in the ProtoBuf definition.
4383    ///
4384    /// The values are not transformed in any way and thus are considered stable
4385    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4386    pub fn as_str_name(&self) -> &'static str {
4387        match self {
4388            Self::Unspecified => "TEMPLATE_VARIABLE_SOURCE_UNSPECIFIED",
4389            Self::Profile => "TEMPLATE_VARIABLE_SOURCE_PROFILE",
4390            Self::Custom => "TEMPLATE_VARIABLE_SOURCE_CUSTOM",
4391        }
4392    }
4393    /// Creates an enum from field names used in the ProtoBuf definition.
4394    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4395        match value {
4396            "TEMPLATE_VARIABLE_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
4397            "TEMPLATE_VARIABLE_SOURCE_PROFILE" => Some(Self::Profile),
4398            "TEMPLATE_VARIABLE_SOURCE_CUSTOM" => Some(Self::Custom),
4399            _ => None,
4400        }
4401    }
4402}
4403/// Review status of a template translation.
4404#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4405#[repr(i32)]
4406pub enum TranslationStatus {
4407    Unspecified = 0,
4408    /// Translation draft, not yet reviewed.
4409    Draft = 1,
4410    /// Translation generated by AI, pending human review.
4411    AiTranslated = 2,
4412    /// Translation is being reviewed by a human.
4413    InReview = 3,
4414    /// Translation has been approved for use.
4415    Approved = 4,
4416}
4417impl TranslationStatus {
4418    /// String value of the enum field names used in the ProtoBuf definition.
4419    ///
4420    /// The values are not transformed in any way and thus are considered stable
4421    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4422    pub fn as_str_name(&self) -> &'static str {
4423        match self {
4424            Self::Unspecified => "TRANSLATION_STATUS_UNSPECIFIED",
4425            Self::Draft => "TRANSLATION_STATUS_DRAFT",
4426            Self::AiTranslated => "TRANSLATION_STATUS_AI_TRANSLATED",
4427            Self::InReview => "TRANSLATION_STATUS_IN_REVIEW",
4428            Self::Approved => "TRANSLATION_STATUS_APPROVED",
4429        }
4430    }
4431    /// Creates an enum from field names used in the ProtoBuf definition.
4432    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4433        match value {
4434            "TRANSLATION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
4435            "TRANSLATION_STATUS_DRAFT" => Some(Self::Draft),
4436            "TRANSLATION_STATUS_AI_TRANSLATED" => Some(Self::AiTranslated),
4437            "TRANSLATION_STATUS_IN_REVIEW" => Some(Self::InReview),
4438            "TRANSLATION_STATUS_APPROVED" => Some(Self::Approved),
4439            _ => None,
4440        }
4441    }
4442}
4443include!("pidgr.v1.tonic.rs");
4444// @@protoc_insertion_point(module)