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