Skip to main content

pidgr_proto/pidgr/v1/
pidgr.v1.rs

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