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