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