Skip to main content

pidgr_proto/pidgr/v1/
pidgr.v1.rs

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