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}
2137/// Request to ingest a batch of touch events from the mobile app.
2138#[derive(Clone, PartialEq, ::prost::Message)]
2139pub struct IngestTouchEventsRequest {
2140    /// Batch of touch events to ingest.
2141    /// Constraints: Max 100 events per batch.
2142    #[prost(message, repeated, tag="1")]
2143    pub events: ::prost::alloc::vec::Vec<TouchEvent>,
2144}
2145/// Response after ingesting touch events.
2146#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2147pub struct IngestTouchEventsResponse {
2148    /// Number of events successfully ingested.
2149    #[prost(int32, tag="1")]
2150    pub ingested_count: i32,
2151}
2152/// A single aggregated data point in a heatmap grid cell.
2153#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2154pub struct HeatmapDataPoint {
2155    /// Grid cell horizontal center as a percentage (0.0–1.0).
2156    #[prost(float, tag="1")]
2157    pub x_pct: f32,
2158    /// Grid cell vertical center as a percentage (0.0–1.0).
2159    #[prost(float, tag="2")]
2160    pub y_pct: f32,
2161    /// Aggregated value for this cell (count, median, or z-score depending on mode).
2162    #[prost(float, tag="3")]
2163    pub value: f32,
2164}
2165/// Per-user touch count for distribution analysis.
2166#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2167pub struct UserTouchCount {
2168    /// User ID.
2169    #[prost(string, tag="1")]
2170    pub user_id: ::prost::alloc::string::String,
2171    /// Total touch count for the user in the query range.
2172    #[prost(int32, tag="2")]
2173    pub count: i32,
2174    /// Resolved email for display.
2175    #[prost(string, tag="3")]
2176    pub user_email: ::prost::alloc::string::String,
2177}
2178/// Request to query aggregated heatmap data for a screen.
2179#[derive(Clone, PartialEq, ::prost::Message)]
2180pub struct QueryHeatmapDataRequest {
2181    /// Screen name to query.
2182    /// Constraints: Max length 200 characters.
2183    #[prost(string, tag="1")]
2184    pub screen_name: ::prost::alloc::string::String,
2185    /// Start of the time range filter (inclusive).
2186    #[prost(message, optional, tag="2")]
2187    pub date_from: ::core::option::Option<::prost_types::Timestamp>,
2188    /// End of the time range filter (inclusive).
2189    #[prost(message, optional, tag="3")]
2190    pub date_to: ::core::option::Option<::prost_types::Timestamp>,
2191    /// Optional: filter by campaign ID.
2192    /// Constraints: UUID format (36 characters).
2193    #[prost(string, tag="4")]
2194    pub campaign_id: ::prost::alloc::string::String,
2195    /// Optional: filter by user ID (required for USER_SPECIFIC mode).
2196    /// Constraints: UUID format (36 characters).
2197    #[prost(string, tag="5")]
2198    pub user_id: ::prost::alloc::string::String,
2199    /// Grid resolution for coordinate rounding. Default: 0.02 (50×50 grid).
2200    /// Constraints: Range 0.005 to 0.1.
2201    #[prost(float, tag="6")]
2202    pub grid_resolution: f32,
2203    /// Aggregation mode.
2204    #[prost(enumeration="HeatmapMode", tag="7")]
2205    pub mode: i32,
2206    /// Optional: filter by event types. Empty list means all types.
2207    #[prost(enumeration="TouchEventType", repeated, tag="8")]
2208    pub event_types: ::prost::alloc::vec::Vec<i32>,
2209}
2210/// Response containing aggregated heatmap data.
2211#[derive(Clone, PartialEq, ::prost::Message)]
2212pub struct QueryHeatmapDataResponse {
2213    /// Aggregated data points for heatmap rendering.
2214    #[prost(message, repeated, tag="1")]
2215    pub data_points: ::prost::alloc::vec::Vec<HeatmapDataPoint>,
2216    /// Per-user touch counts for distribution chart rendering.
2217    /// Only populated when mode is TOTAL or MEDIAN.
2218    #[prost(message, repeated, tag="2")]
2219    pub user_touch_counts: ::prost::alloc::vec::Vec<UserTouchCount>,
2220    /// URL to a mobile-captured screenshot for this screen, if available.
2221    /// Empty string when no screenshot exists.
2222    #[prost(string, tag="3")]
2223    pub screenshot_url: ::prost::alloc::string::String,
2224}
2225/// Request to upload a screenshot captured from the mobile app.
2226#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2227pub struct UploadScreenshotRequest {
2228    /// Screen name matching React Navigation route (e.g. "MessageDetail::<campaign_uuid>").
2229    /// Constraints: Max length 200 characters.
2230    #[prost(string, tag="1")]
2231    pub screen_name: ::prost::alloc::string::String,
2232    /// App version that captured the screenshot (e.g. "1.15.0").
2233    #[prost(string, tag="2")]
2234    pub app_version: ::prost::alloc::string::String,
2235    /// PNG image data.
2236    /// Constraints: Max 512KB.
2237    #[prost(bytes="vec", tag="3")]
2238    pub image_data: ::prost::alloc::vec::Vec<u8>,
2239}
2240/// Response after uploading a screenshot.
2241#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2242pub struct UploadScreenshotResponse {
2243    /// S3 URL where the screenshot was stored.
2244    #[prost(string, tag="1")]
2245    pub url: ::prost::alloc::string::String,
2246}
2247/// A screen screenshot stored as a static asset.
2248#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2249pub struct ScreenScreenshot {
2250    /// Screen name matching React Navigation route.
2251    #[prost(string, tag="1")]
2252    pub screen_name: ::prost::alloc::string::String,
2253    /// S3 URL to the screenshot image.
2254    #[prost(string, tag="2")]
2255    pub url: ::prost::alloc::string::String,
2256    /// App version this screenshot corresponds to.
2257    #[prost(string, tag="3")]
2258    pub app_version: ::prost::alloc::string::String,
2259}
2260/// Request to list available screen screenshots.
2261#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2262pub struct ListScreenshotsRequest {
2263}
2264/// Response containing available screen screenshots.
2265#[derive(Clone, PartialEq, ::prost::Message)]
2266pub struct ListScreenshotsResponse {
2267    /// Available screen screenshots with their URLs and versions.
2268    #[prost(message, repeated, tag="1")]
2269    pub screenshots: ::prost::alloc::vec::Vec<ScreenScreenshot>,
2270}
2271// ─── Enums ──────────────────────────────────────────────────────────────────
2272
2273/// Type of touch event captured on the mobile app.
2274#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2275#[repr(i32)]
2276pub enum TouchEventType {
2277    /// Default value; not a valid event type.
2278    Unspecified = 0,
2279    /// A single tap on the screen.
2280    Tap = 1,
2281    /// A long press (held for 500ms+).
2282    LongPress = 2,
2283    /// A periodic scroll position sample (viewport midpoint every 2s).
2284    Scroll = 3,
2285    /// The user tapped an action button (e.g. "Acknowledge").
2286    ActionClick = 4,
2287}
2288impl TouchEventType {
2289    /// String value of the enum field names used in the ProtoBuf definition.
2290    ///
2291    /// The values are not transformed in any way and thus are considered stable
2292    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2293    pub fn as_str_name(&self) -> &'static str {
2294        match self {
2295            Self::Unspecified => "TOUCH_EVENT_TYPE_UNSPECIFIED",
2296            Self::Tap => "TOUCH_EVENT_TYPE_TAP",
2297            Self::LongPress => "TOUCH_EVENT_TYPE_LONG_PRESS",
2298            Self::Scroll => "TOUCH_EVENT_TYPE_SCROLL",
2299            Self::ActionClick => "TOUCH_EVENT_TYPE_ACTION_CLICK",
2300        }
2301    }
2302    /// Creates an enum from field names used in the ProtoBuf definition.
2303    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2304        match value {
2305            "TOUCH_EVENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2306            "TOUCH_EVENT_TYPE_TAP" => Some(Self::Tap),
2307            "TOUCH_EVENT_TYPE_LONG_PRESS" => Some(Self::LongPress),
2308            "TOUCH_EVENT_TYPE_SCROLL" => Some(Self::Scroll),
2309            "TOUCH_EVENT_TYPE_ACTION_CLICK" => Some(Self::ActionClick),
2310            _ => None,
2311        }
2312    }
2313}
2314/// Aggregation mode for heatmap data queries.
2315#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2316#[repr(i32)]
2317pub enum HeatmapMode {
2318    /// Default value; not a valid mode.
2319    Unspecified = 0,
2320    /// Sum of all users' touches per grid cell (default).
2321    Total = 1,
2322    /// Median touch count per grid cell across all users.
2323    Median = 2,
2324    /// Highlight cells where a specific user deviates more than 2σ from the median.
2325    /// Requires user_id to be set in the query request.
2326    UserSpecific = 3,
2327}
2328impl HeatmapMode {
2329    /// String value of the enum field names used in the ProtoBuf definition.
2330    ///
2331    /// The values are not transformed in any way and thus are considered stable
2332    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2333    pub fn as_str_name(&self) -> &'static str {
2334        match self {
2335            Self::Unspecified => "HEATMAP_MODE_UNSPECIFIED",
2336            Self::Total => "HEATMAP_MODE_TOTAL",
2337            Self::Median => "HEATMAP_MODE_MEDIAN",
2338            Self::UserSpecific => "HEATMAP_MODE_USER_SPECIFIC",
2339        }
2340    }
2341    /// Creates an enum from field names used in the ProtoBuf definition.
2342    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2343        match value {
2344            "HEATMAP_MODE_UNSPECIFIED" => Some(Self::Unspecified),
2345            "HEATMAP_MODE_TOTAL" => Some(Self::Total),
2346            "HEATMAP_MODE_MEDIAN" => Some(Self::Median),
2347            "HEATMAP_MODE_USER_SPECIFIC" => Some(Self::UserSpecific),
2348            _ => None,
2349        }
2350    }
2351}
2352// ─── Messages ───────────────────────────────────────────────────────────────
2353
2354/// A single entry in a user's inbox, combining a message with its delivery state.
2355#[derive(Clone, PartialEq, ::prost::Message)]
2356pub struct InboxEntry {
2357    /// ID of the delivery record for this inbox entry.
2358    /// Constraints: UUID format (36 characters).
2359    #[prost(string, tag="1")]
2360    pub delivery_id: ::prost::alloc::string::String,
2361    /// The fully rendered message content.
2362    #[prost(message, optional, tag="2")]
2363    pub message: ::core::option::Option<Message>,
2364    /// Current delivery status (e.g. DELIVERED, ACKNOWLEDGED).
2365    #[prost(enumeration="DeliveryStatus", tag="3")]
2366    pub status: i32,
2367    /// Whether the user has read this message.
2368    #[prost(bool, tag="4")]
2369    pub read: bool,
2370    /// Timestamp when the message was received in the inbox.
2371    #[prost(message, optional, tag="5")]
2372    pub received_at: ::core::option::Option<::prost_types::Timestamp>,
2373}
2374/// Request to sync inbox entries since a given timestamp.
2375#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2376pub struct SyncRequest {
2377    /// Fetch entries newer than this timestamp. Omit for initial sync.
2378    #[prost(message, optional, tag="1")]
2379    pub since: ::core::option::Option<::prost_types::Timestamp>,
2380    /// Maximum number of entries to return.
2381    /// Constraints: Valid range 1 to 200.
2382    #[prost(int32, tag="2")]
2383    pub limit: i32,
2384}
2385/// Response containing synced inbox entries.
2386#[derive(Clone, PartialEq, ::prost::Message)]
2387pub struct SyncResponse {
2388    /// Inbox entries newer than the requested timestamp.
2389    #[prost(message, repeated, tag="1")]
2390    pub entries: ::prost::alloc::vec::Vec<InboxEntry>,
2391    /// Cursor timestamp to use for the next sync call.
2392    #[prost(message, optional, tag="2")]
2393    pub next_since: ::core::option::Option<::prost_types::Timestamp>,
2394}
2395/// Request to mark a message as read.
2396#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2397pub struct MarkReadRequest {
2398    /// ID of the delivery to mark as read.
2399    /// Constraints: UUID format (36 characters).
2400    #[prost(string, tag="1")]
2401    pub delivery_id: ::prost::alloc::string::String,
2402}
2403/// Response after marking a message as read.
2404#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2405pub struct MarkReadResponse {
2406    /// Whether the read status was successfully updated.
2407    #[prost(bool, tag="1")]
2408    pub success: bool,
2409}
2410/// Request to retrieve a single message by delivery ID.
2411#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2412pub struct GetMessageRequest {
2413    /// ID of the delivery to retrieve.
2414    /// Constraints: UUID format (36 characters).
2415    #[prost(string, tag="1")]
2416    pub delivery_id: ::prost::alloc::string::String,
2417}
2418/// Response containing the requested inbox entry.
2419#[derive(Clone, PartialEq, ::prost::Message)]
2420pub struct GetMessageResponse {
2421    /// The inbox entry for the requested delivery.
2422    #[prost(message, optional, tag="1")]
2423    pub entry: ::core::option::Option<InboxEntry>,
2424}
2425// ─── Messages ───────────────────────────────────────────────────────────────
2426
2427/// A shareable invite link that allows users to self-join an organization.
2428/// Links carry a role assignment and optional usage/expiry constraints.
2429#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2430pub struct InviteLink {
2431    /// Unique identifier for the invite link.
2432    #[prost(string, tag="1")]
2433    pub id: ::prost::alloc::string::String,
2434    /// Cryptographically random base64url-encoded token (43 characters).
2435    #[prost(string, tag="2")]
2436    pub token: ::prost::alloc::string::String,
2437    /// ID of the role assigned to users who redeem this link.
2438    #[prost(string, tag="3")]
2439    pub role_id: ::prost::alloc::string::String,
2440    /// Maximum number of times this link can be redeemed.
2441    /// 0 means unlimited.
2442    #[prost(int32, tag="4")]
2443    pub max_uses: i32,
2444    /// Number of times this link has been redeemed.
2445    #[prost(int32, tag="5")]
2446    pub use_count: i32,
2447    /// When the link expires. Empty if no expiry.
2448    #[prost(message, optional, tag="6")]
2449    pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
2450    /// When the link was revoked. Empty if not revoked.
2451    #[prost(message, optional, tag="7")]
2452    pub revoked_at: ::core::option::Option<::prost_types::Timestamp>,
2453    /// ID of the admin who created the link.
2454    #[prost(string, tag="8")]
2455    pub created_by: ::prost::alloc::string::String,
2456    /// When the link was created.
2457    #[prost(message, optional, tag="9")]
2458    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
2459}
2460/// Request to create a new invite link for the organization.
2461#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2462pub struct CreateInviteLinkRequest {
2463    /// ID of the role to assign. Defaults to the organization's employee role if empty.
2464    #[prost(string, tag="1")]
2465    pub role_id: ::prost::alloc::string::String,
2466    /// Maximum number of redemptions. 0 means unlimited.
2467    #[prost(int32, tag="2")]
2468    pub max_uses: i32,
2469    /// Number of hours until the link expires. 0 means no expiry.
2470    /// Constraints: Valid range 0 to 8760 (1 year).
2471    #[prost(int32, tag="3")]
2472    pub expires_in_hours: i32,
2473}
2474/// Response after creating an invite link.
2475#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2476pub struct CreateInviteLinkResponse {
2477    /// The newly created invite link.
2478    #[prost(message, optional, tag="1")]
2479    pub invite_link: ::core::option::Option<InviteLink>,
2480    /// Full URL for sharing (e.g. "<https://app.pidgr.com/join?token=<TOKEN>">).
2481    #[prost(string, tag="2")]
2482    pub url: ::prost::alloc::string::String,
2483}
2484/// Request to list all invite links for the organization.
2485#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2486pub struct ListInviteLinksRequest {
2487}
2488/// Response containing all invite links for the organization.
2489#[derive(Clone, PartialEq, ::prost::Message)]
2490pub struct ListInviteLinksResponse {
2491    /// All invite links (active, expired, maxed-out, and revoked), ordered by creation date descending.
2492    #[prost(message, repeated, tag="1")]
2493    pub invite_links: ::prost::alloc::vec::Vec<InviteLink>,
2494}
2495/// Request to revoke an invite link.
2496#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2497pub struct RevokeInviteLinkRequest {
2498    /// ID of the invite link to revoke. Required.
2499    #[prost(string, tag="1")]
2500    pub invite_link_id: ::prost::alloc::string::String,
2501}
2502/// Response after revoking an invite link.
2503#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2504pub struct RevokeInviteLinkResponse {
2505}
2506/// Request to redeem an invite link (authenticated — email extracted from JWT).
2507#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2508pub struct RedeemInviteLinkRequest {
2509    /// The invite link token from the URL query parameter.
2510    #[prost(string, tag="1")]
2511    pub token: ::prost::alloc::string::String,
2512}
2513/// Response after redeeming an invite link.
2514#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2515pub struct RedeemInviteLinkResponse {
2516    /// Name of the organization the user was added to.
2517    #[prost(string, tag="1")]
2518    pub organization_name: ::prost::alloc::string::String,
2519}
2520/// Request to validate an invite link and provision a user account if needed (unauthenticated).
2521#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2522pub struct ValidateInviteLinkRequest {
2523    /// The invite link token from the URL query parameter.
2524    #[prost(string, tag="1")]
2525    pub token: ::prost::alloc::string::String,
2526    /// Email address of the user joining the organization.
2527    /// Constraints: Max length 254 characters (RFC 5321).
2528    #[prost(string, tag="2")]
2529    pub email: ::prost::alloc::string::String,
2530}
2531/// Response after validating an invite link.
2532#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2533pub struct ValidateInviteLinkResponse {
2534    /// Name of the organization the invite link belongs to.
2535    #[prost(string, tag="1")]
2536    pub organization_name: ::prost::alloc::string::String,
2537}
2538// ─── Messages ───────────────────────────────────────────────────────────────
2539
2540/// Request to invite a new user to the organization.
2541#[derive(Clone, PartialEq, ::prost::Message)]
2542pub struct InviteUserRequest {
2543    /// Email address to send the invitation to.
2544    /// Constraints: Max length 254 characters (RFC 5321).
2545    #[prost(string, tag="1")]
2546    pub email: ::prost::alloc::string::String,
2547    /// Display name for the invited user.
2548    /// Constraints: Max length 200 characters.
2549    #[prost(string, tag="2")]
2550    pub name: ::prost::alloc::string::String,
2551    /// ID of the role to assign. Defaults to the organization's employee role if empty.
2552    #[prost(string, tag="4")]
2553    pub role_id: ::prost::alloc::string::String,
2554    /// Optional profile attributes to pre-fill at invitation time.
2555    #[prost(message, optional, tag="5")]
2556    pub profile: ::core::option::Option<UserProfile>,
2557}
2558/// Response after inviting a user.
2559#[derive(Clone, PartialEq, ::prost::Message)]
2560pub struct InviteUserResponse {
2561    /// The newly created user (status: INVITED).
2562    #[prost(message, optional, tag="1")]
2563    pub user: ::core::option::Option<User>,
2564}
2565/// Request to retrieve a user by ID.
2566#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2567pub struct GetUserRequest {
2568    /// ID of the user to retrieve.
2569    #[prost(string, tag="1")]
2570    pub user_id: ::prost::alloc::string::String,
2571}
2572/// Response containing the requested user.
2573#[derive(Clone, PartialEq, ::prost::Message)]
2574pub struct GetUserResponse {
2575    /// The requested user.
2576    #[prost(message, optional, tag="1")]
2577    pub user: ::core::option::Option<User>,
2578}
2579/// Request to list users in the organization with pagination.
2580#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2581pub struct ListUsersRequest {
2582    /// Pagination parameters.
2583    #[prost(message, optional, tag="1")]
2584    pub pagination: ::core::option::Option<Pagination>,
2585}
2586/// Response containing a page of users.
2587#[derive(Clone, PartialEq, ::prost::Message)]
2588pub struct ListUsersResponse {
2589    /// List of users in this page.
2590    #[prost(message, repeated, tag="1")]
2591    pub users: ::prost::alloc::vec::Vec<User>,
2592    /// Pagination metadata for fetching subsequent pages.
2593    #[prost(message, optional, tag="2")]
2594    pub pagination_meta: ::core::option::Option<PaginationMeta>,
2595}
2596/// Request to change a user's role within the organization.
2597#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2598pub struct UpdateUserRoleRequest {
2599    /// ID of the user whose role to update.
2600    #[prost(string, tag="1")]
2601    pub user_id: ::prost::alloc::string::String,
2602    /// ID of the new role to assign.
2603    #[prost(string, tag="2")]
2604    pub role_id: ::prost::alloc::string::String,
2605}
2606/// Response after updating a user's role.
2607#[derive(Clone, PartialEq, ::prost::Message)]
2608pub struct UpdateUserRoleResponse {
2609    /// The updated user with the new role.
2610    #[prost(message, optional, tag="1")]
2611    pub user: ::core::option::Option<User>,
2612}
2613/// Request to deactivate a user within the organization.
2614#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2615pub struct DeactivateUserRequest {
2616    /// ID of the user to deactivate.
2617    #[prost(string, tag="1")]
2618    pub user_id: ::prost::alloc::string::String,
2619}
2620/// Response after deactivating a user.
2621#[derive(Clone, PartialEq, ::prost::Message)]
2622pub struct DeactivateUserResponse {
2623    /// The deactivated user (status: DEACTIVATED).
2624    #[prost(message, optional, tag="1")]
2625    pub user: ::core::option::Option<User>,
2626}
2627/// Request to reactivate a deactivated user.
2628#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2629pub struct ReactivateUserRequest {
2630    /// ID of the user to reactivate.
2631    #[prost(string, tag="1")]
2632    pub user_id: ::prost::alloc::string::String,
2633}
2634/// Response after reactivating a user.
2635#[derive(Clone, PartialEq, ::prost::Message)]
2636pub struct ReactivateUserResponse {
2637    /// The reactivated user (status: INVITED).
2638    #[prost(message, optional, tag="1")]
2639    pub user: ::core::option::Option<User>,
2640}
2641/// Request to revoke an invitation for a user who has not yet registered.
2642#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2643pub struct RevokeInviteRequest {
2644    /// ID of the invited user to remove.
2645    /// Constraints: UUID format (36 characters).
2646    #[prost(string, tag="1")]
2647    pub user_id: ::prost::alloc::string::String,
2648}
2649/// Response after revoking an invitation. Empty on success.
2650#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2651pub struct RevokeInviteResponse {
2652}
2653/// Request to update a user's profile attributes.
2654#[derive(Clone, PartialEq, ::prost::Message)]
2655pub struct UpdateUserProfileRequest {
2656    /// ID of the user whose profile to update.
2657    /// Empty or matching the caller's own ID allows self-update without PERMISSION_MEMBERS_MANAGE.
2658    #[prost(string, tag="1")]
2659    pub user_id: ::prost::alloc::string::String,
2660    /// Profile attributes to set. All provided fields overwrite existing values.
2661    #[prost(message, optional, tag="2")]
2662    pub profile: ::core::option::Option<UserProfile>,
2663}
2664/// Response after updating a user's profile.
2665#[derive(Clone, PartialEq, ::prost::Message)]
2666pub struct UpdateUserProfileResponse {
2667    /// The updated user with the new profile.
2668    #[prost(message, optional, tag="1")]
2669    pub user: ::core::option::Option<User>,
2670}
2671/// Request to retrieve the caller's platform settings.
2672#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2673pub struct GetUserSettingsRequest {
2674}
2675/// Response containing the caller's platform settings.
2676#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2677pub struct GetUserSettingsResponse {
2678    /// Current settings. Fields at their default value indicate the platform default.
2679    #[prost(message, optional, tag="1")]
2680    pub settings: ::core::option::Option<UserSettings>,
2681}
2682/// Request to update the caller's platform settings.
2683#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2684pub struct UpdateUserSettingsRequest {
2685    /// Settings to update. Only fields with non-default (non-UNSPECIFIED) values
2686    /// are applied; default-valued fields are left unchanged.
2687    #[prost(message, optional, tag="1")]
2688    pub settings: ::core::option::Option<UserSettings>,
2689}
2690/// Response after updating the caller's platform settings.
2691#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2692pub struct UpdateUserSettingsResponse {
2693    /// The full settings after the update.
2694    #[prost(message, optional, tag="1")]
2695    pub settings: ::core::option::Option<UserSettings>,
2696}
2697/// Request to invite multiple users to the organization in a single call.
2698#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2699pub struct BulkInviteUsersRequest {
2700    /// Email addresses to invite.
2701    /// Constraints: Min 1, max 100 emails. Duplicates are deduplicated before processing.
2702    #[prost(string, repeated, tag="1")]
2703    pub emails: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2704    /// ID of the role to assign. Defaults to the organization's employee role if empty.
2705    #[prost(string, tag="2")]
2706    pub role_id: ::prost::alloc::string::String,
2707}
2708/// Per-email result within a bulk invite operation.
2709#[derive(Clone, PartialEq, ::prost::Message)]
2710pub struct BulkInviteResult {
2711    /// The email address that was processed.
2712    #[prost(string, tag="1")]
2713    pub email: ::prost::alloc::string::String,
2714    /// Whether the invitation succeeded.
2715    #[prost(bool, tag="2")]
2716    pub success: bool,
2717    /// Error message if the invitation failed (e.g. "user already exists").
2718    /// Empty on success.
2719    #[prost(string, tag="3")]
2720    pub error: ::prost::alloc::string::String,
2721    /// The created user. Only set on success.
2722    #[prost(message, optional, tag="4")]
2723    pub user: ::core::option::Option<User>,
2724}
2725/// Response after bulk inviting users.
2726#[derive(Clone, PartialEq, ::prost::Message)]
2727pub struct BulkInviteUsersResponse {
2728    /// Per-email results in the same order as the deduplicated input.
2729    #[prost(message, repeated, tag="1")]
2730    pub results: ::prost::alloc::vec::Vec<BulkInviteResult>,
2731    /// Number of users successfully invited.
2732    #[prost(int32, tag="2")]
2733    pub invited_count: i32,
2734    /// Number of emails that failed.
2735    #[prost(int32, tag="3")]
2736    pub failed_count: i32,
2737}
2738/// Request to confirm passkey enrollment after client-side WebAuthn registration.
2739/// The server verifies that the caller has at least one registered WebAuthn
2740/// credential before setting the enrollment attribute.
2741#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2742pub struct ConfirmPasskeyEnrollmentRequest {
2743}
2744/// Response after confirming passkey enrollment.
2745#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2746pub struct ConfirmPasskeyEnrollmentResponse {
2747    /// Whether enrollment was confirmed and the user attribute was updated.
2748    #[prost(bool, tag="1")]
2749    pub confirmed: bool,
2750}
2751// ─── Messages ───────────────────────────────────────────────────────────────
2752
2753/// Maps an identity provider claim to a user profile field.
2754/// Used for automatic profile population when users authenticate via SSO/SAML.
2755#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2756pub struct SsoAttributeMapping {
2757    /// Claim name from the identity provider (e.g. "urn:oid:2.5.4.11", "given_name").
2758    /// Constraints: Max length 500 characters.
2759    #[prost(string, tag="1")]
2760    pub idp_claim: ::prost::alloc::string::String,
2761    /// Target UserProfile field name (e.g. "department", "first_name").
2762    /// For custom attributes, use "custom:" prefix (e.g. "custom:cost_center").
2763    /// Constraints: Max length 100 characters.
2764    #[prost(string, tag="2")]
2765    pub profile_field: ::prost::alloc::string::String,
2766}
2767/// An organization (tenant) in the Pidgr platform.
2768#[derive(Clone, PartialEq, ::prost::Message)]
2769pub struct Organization {
2770    /// Unique identifier for the organization.
2771    #[prost(string, tag="1")]
2772    pub id: ::prost::alloc::string::String,
2773    /// Organization display name.
2774    /// Constraints: Max length 200 characters.
2775    #[prost(string, tag="2")]
2776    pub name: ::prost::alloc::string::String,
2777    /// Default workflow used when campaigns don't specify one.
2778    #[prost(message, optional, tag="3")]
2779    pub default_workflow: ::core::option::Option<WorkflowDefinition>,
2780    /// Timestamp when the organization was created.
2781    #[prost(message, optional, tag="4")]
2782    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
2783    /// Industry vertical.
2784    #[prost(enumeration="Industry", tag="5")]
2785    pub industry: i32,
2786    /// Employee headcount range.
2787    #[prost(enumeration="CompanySize", tag="6")]
2788    pub company_size: i32,
2789    /// SSO identity provider claim-to-profile mappings.
2790    /// Empty when the organization does not use SSO.
2791    #[prost(message, repeated, tag="7")]
2792    pub sso_attribute_mappings: ::prost::alloc::vec::Vec<SsoAttributeMapping>,
2793    /// Default language for new users in this organization.
2794    /// Empty means no org default (users auto-detect from device/browser).
2795    /// Valid values: en, es, pt-BR, zh, ja.
2796    #[prost(string, tag="8")]
2797    pub default_locale: ::prost::alloc::string::String,
2798}
2799/// Request to create a new organization with an admin user.
2800/// Supports API key auth (service-to-service) and JWT auth (self-service onboarding).
2801#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2802pub struct CreateOrganizationRequest {
2803    /// Name for the new organization.
2804    /// Constraints: Max length 200 characters.
2805    #[prost(string, tag="1")]
2806    pub name: ::prost::alloc::string::String,
2807    /// Email address for the initial admin user.
2808    /// Only used with API key auth; ignored with JWT auth (email derived from identity provider subject).
2809    #[prost(string, tag="2")]
2810    pub admin_email: ::prost::alloc::string::String,
2811    /// Industry vertical for the organization.
2812    #[prost(enumeration="Industry", tag="3")]
2813    pub industry: i32,
2814    /// Employee headcount range.
2815    #[prost(enumeration="CompanySize", tag="4")]
2816    pub company_size: i32,
2817    /// Access code required during early access (JWT auth only). Ignored with API key auth.
2818    /// Format: PIDGR-XXXXXXXX (8 alphanumeric characters).
2819    #[prost(string, tag="5")]
2820    pub access_code: ::prost::alloc::string::String,
2821}
2822/// Response after creating an organization.
2823#[derive(Clone, PartialEq, ::prost::Message)]
2824pub struct CreateOrganizationResponse {
2825    /// The newly created organization.
2826    #[prost(message, optional, tag="1")]
2827    pub organization: ::core::option::Option<Organization>,
2828    /// The admin user created for the organization.
2829    #[prost(message, optional, tag="2")]
2830    pub admin_user: ::core::option::Option<User>,
2831}
2832/// Request to retrieve the organization for the authenticated user.
2833#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2834pub struct GetOrganizationRequest {
2835}
2836/// Response containing the organization.
2837#[derive(Clone, PartialEq, ::prost::Message)]
2838pub struct GetOrganizationResponse {
2839    /// The organization the authenticated user belongs to.
2840    #[prost(message, optional, tag="1")]
2841    pub organization: ::core::option::Option<Organization>,
2842}
2843/// Request to update organization settings.
2844#[derive(Clone, PartialEq, ::prost::Message)]
2845pub struct UpdateOrganizationRequest {
2846    /// New organization name. Empty string leaves unchanged.
2847    /// Constraints: Max length 200 characters.
2848    #[prost(string, tag="1")]
2849    pub name: ::prost::alloc::string::String,
2850    /// New default workflow definition. Null leaves unchanged.
2851    #[prost(message, optional, tag="2")]
2852    pub default_workflow: ::core::option::Option<WorkflowDefinition>,
2853    /// New industry vertical. UNSPECIFIED leaves unchanged.
2854    #[prost(enumeration="Industry", tag="3")]
2855    pub industry: i32,
2856    /// New employee headcount range. UNSPECIFIED leaves unchanged.
2857    #[prost(enumeration="CompanySize", tag="4")]
2858    pub company_size: i32,
2859    /// New default language for new users. Empty string leaves unchanged.
2860    /// Valid values: en, es, pt-BR, zh, ja.
2861    #[prost(string, tag="5")]
2862    pub default_locale: ::prost::alloc::string::String,
2863}
2864/// Response after updating the organization.
2865#[derive(Clone, PartialEq, ::prost::Message)]
2866pub struct UpdateOrganizationResponse {
2867    /// The updated organization.
2868    #[prost(message, optional, tag="1")]
2869    pub organization: ::core::option::Option<Organization>,
2870}
2871/// Request to replace all SSO attribute mappings for the organization.
2872#[derive(Clone, PartialEq, ::prost::Message)]
2873pub struct UpdateSsoAttributeMappingsRequest {
2874    /// Complete list of SSO mappings (replaces all existing mappings).
2875    #[prost(message, repeated, tag="1")]
2876    pub sso_attribute_mappings: ::prost::alloc::vec::Vec<SsoAttributeMapping>,
2877}
2878/// Response after updating SSO attribute mappings.
2879#[derive(Clone, PartialEq, ::prost::Message)]
2880pub struct UpdateSsoAttributeMappingsResponse {
2881    /// The updated organization with the new SSO mappings.
2882    #[prost(message, optional, tag="1")]
2883    pub organization: ::core::option::Option<Organization>,
2884}
2885// ─── Enums ───────────────────────────────────────────────────────────────────
2886
2887/// Industry vertical for an organization.
2888#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2889#[repr(i32)]
2890pub enum Industry {
2891    Unspecified = 0,
2892    Technology = 1,
2893    Finance = 2,
2894    Healthcare = 3,
2895    Education = 4,
2896    Retail = 5,
2897    Manufacturing = 6,
2898    Media = 7,
2899    Other = 8,
2900}
2901impl Industry {
2902    /// String value of the enum field names used in the ProtoBuf definition.
2903    ///
2904    /// The values are not transformed in any way and thus are considered stable
2905    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2906    pub fn as_str_name(&self) -> &'static str {
2907        match self {
2908            Self::Unspecified => "INDUSTRY_UNSPECIFIED",
2909            Self::Technology => "INDUSTRY_TECHNOLOGY",
2910            Self::Finance => "INDUSTRY_FINANCE",
2911            Self::Healthcare => "INDUSTRY_HEALTHCARE",
2912            Self::Education => "INDUSTRY_EDUCATION",
2913            Self::Retail => "INDUSTRY_RETAIL",
2914            Self::Manufacturing => "INDUSTRY_MANUFACTURING",
2915            Self::Media => "INDUSTRY_MEDIA",
2916            Self::Other => "INDUSTRY_OTHER",
2917        }
2918    }
2919    /// Creates an enum from field names used in the ProtoBuf definition.
2920    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2921        match value {
2922            "INDUSTRY_UNSPECIFIED" => Some(Self::Unspecified),
2923            "INDUSTRY_TECHNOLOGY" => Some(Self::Technology),
2924            "INDUSTRY_FINANCE" => Some(Self::Finance),
2925            "INDUSTRY_HEALTHCARE" => Some(Self::Healthcare),
2926            "INDUSTRY_EDUCATION" => Some(Self::Education),
2927            "INDUSTRY_RETAIL" => Some(Self::Retail),
2928            "INDUSTRY_MANUFACTURING" => Some(Self::Manufacturing),
2929            "INDUSTRY_MEDIA" => Some(Self::Media),
2930            "INDUSTRY_OTHER" => Some(Self::Other),
2931            _ => None,
2932        }
2933    }
2934}
2935/// Employee headcount range for an organization.
2936#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2937#[repr(i32)]
2938pub enum CompanySize {
2939    Unspecified = 0,
2940    CompanySize1200 = 1,
2941    CompanySize200500 = 2,
2942    CompanySize5001000 = 3,
2943    CompanySize10005000 = 4,
2944    CompanySize5000Plus = 5,
2945}
2946impl CompanySize {
2947    /// String value of the enum field names used in the ProtoBuf definition.
2948    ///
2949    /// The values are not transformed in any way and thus are considered stable
2950    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2951    pub fn as_str_name(&self) -> &'static str {
2952        match self {
2953            Self::Unspecified => "COMPANY_SIZE_UNSPECIFIED",
2954            Self::CompanySize1200 => "COMPANY_SIZE_1_200",
2955            Self::CompanySize200500 => "COMPANY_SIZE_200_500",
2956            Self::CompanySize5001000 => "COMPANY_SIZE_500_1000",
2957            Self::CompanySize10005000 => "COMPANY_SIZE_1000_5000",
2958            Self::CompanySize5000Plus => "COMPANY_SIZE_5000_PLUS",
2959        }
2960    }
2961    /// Creates an enum from field names used in the ProtoBuf definition.
2962    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2963        match value {
2964            "COMPANY_SIZE_UNSPECIFIED" => Some(Self::Unspecified),
2965            "COMPANY_SIZE_1_200" => Some(Self::CompanySize1200),
2966            "COMPANY_SIZE_200_500" => Some(Self::CompanySize200500),
2967            "COMPANY_SIZE_500_1000" => Some(Self::CompanySize5001000),
2968            "COMPANY_SIZE_1000_5000" => Some(Self::CompanySize10005000),
2969            "COMPANY_SIZE_5000_PLUS" => Some(Self::CompanySize5000Plus),
2970            _ => None,
2971        }
2972    }
2973}
2974// ─── Messages ───────────────────────────────────────────────────────────────
2975
2976/// Per-user rendering context containing variable substitutions.
2977#[derive(Clone, PartialEq, ::prost::Message)]
2978pub struct UserRenderContext {
2979    /// ID of the user being rendered for.
2980    #[prost(string, tag="1")]
2981    pub user_id: ::prost::alloc::string::String,
2982    /// Variable name-value pairs to substitute into the template.
2983    /// Constraints: Max 100 entries. Key max length 100 characters, value max length 10000 characters.
2984    #[prost(map="string, string", tag="2")]
2985    pub variables: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
2986}
2987/// Request to render a template for a batch of users.
2988#[derive(Clone, PartialEq, ::prost::Message)]
2989pub struct RenderBatchRequest {
2990    /// ID of the template to render.
2991    #[prost(string, tag="1")]
2992    pub template_id: ::prost::alloc::string::String,
2993    /// Version of the template to render.
2994    #[prost(int32, tag="2")]
2995    pub version: i32,
2996    /// Per-user rendering contexts with variable substitutions.
2997    /// Constraints: Max 10000 users per batch.
2998    #[prost(message, repeated, tag="3")]
2999    pub users: ::prost::alloc::vec::Vec<UserRenderContext>,
3000}
3001/// Streamed response for each user's rendered message.
3002/// One response is emitted per user in the batch.
3003#[derive(Clone, PartialEq, ::prost::Message)]
3004pub struct RenderBatchResponse {
3005    /// ID of the user this result is for.
3006    #[prost(string, tag="1")]
3007    pub user_id: ::prost::alloc::string::String,
3008    /// The rendered message (set on success).
3009    #[prost(message, optional, tag="2")]
3010    pub message: ::core::option::Option<Message>,
3011    /// Error message if rendering failed for this user (empty on success).
3012    #[prost(string, tag="3")]
3013    pub error: ::prost::alloc::string::String,
3014}
3015// ─── Messages ───────────────────────────────────────────────────────────────
3016
3017/// A session recording summary from the analytics provider.
3018#[derive(Clone, PartialEq, ::prost::Message)]
3019pub struct SessionRecording {
3020    /// Recording ID from the analytics provider.
3021    #[prost(string, tag="1")]
3022    pub id: ::prost::alloc::string::String,
3023    /// Analytics user identifier (maps to a pidgr user).
3024    #[prost(string, tag="2")]
3025    pub analytics_user_id: ::prost::alloc::string::String,
3026    /// Timestamp when the recording started.
3027    #[prost(message, optional, tag="3")]
3028    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
3029    /// Timestamp when the recording ended.
3030    #[prost(message, optional, tag="4")]
3031    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
3032    /// Duration of the recording in seconds.
3033    #[prost(int32, tag="5")]
3034    pub duration_seconds: i32,
3035    /// Activity score (0.0–1.0).
3036    #[prost(float, tag="6")]
3037    pub activity_score: f32,
3038    /// Resolved user email from analytics_user_id.
3039    /// Empty if the user could not be resolved.
3040    #[prost(string, tag="7")]
3041    pub user_email: ::prost::alloc::string::String,
3042}
3043/// Request to list session recordings.
3044#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3045pub struct ListSessionRecordingsRequest {
3046    /// Optional: filter recordings by campaign ID (mapped to analytics property filter).
3047    /// Constraints: UUID format (36 characters).
3048    #[prost(string, tag="1")]
3049    pub campaign_id: ::prost::alloc::string::String,
3050    /// Optional: start of the time range filter (inclusive).
3051    #[prost(message, optional, tag="2")]
3052    pub date_from: ::core::option::Option<::prost_types::Timestamp>,
3053    /// Optional: end of the time range filter (inclusive).
3054    #[prost(message, optional, tag="3")]
3055    pub date_to: ::core::option::Option<::prost_types::Timestamp>,
3056    /// Pagination parameters.
3057    #[prost(message, optional, tag="4")]
3058    pub pagination: ::core::option::Option<Pagination>,
3059}
3060/// Response containing a page of session recordings.
3061#[derive(Clone, PartialEq, ::prost::Message)]
3062pub struct ListSessionRecordingsResponse {
3063    /// List of session recordings in this page.
3064    #[prost(message, repeated, tag="1")]
3065    pub recordings: ::prost::alloc::vec::Vec<SessionRecording>,
3066    /// Pagination metadata for fetching subsequent pages.
3067    #[prost(message, optional, tag="2")]
3068    pub pagination_meta: ::core::option::Option<PaginationMeta>,
3069}
3070/// Request to fetch rrweb snapshot events for a recording.
3071#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3072pub struct GetSessionSnapshotsRequest {
3073    /// Recording ID from the analytics provider.
3074    /// Constraints: Max length 200 characters.
3075    #[prost(string, tag="1")]
3076    pub recording_id: ::prost::alloc::string::String,
3077}
3078/// Response containing rrweb snapshot events.
3079#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3080pub struct GetSessionSnapshotsResponse {
3081    /// JSON-encoded array of rrweb eventWithTime objects.
3082    /// Clients parse this JSON to feed into rrweb-player.
3083    #[prost(string, tag="1")]
3084    pub snapshot_data: ::prost::alloc::string::String,
3085}
3086// ─── Messages ───────────────────────────────────────────────────────────────
3087
3088/// Request to list all roles in the caller's organization.
3089#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3090pub struct ListRolesRequest {
3091}
3092/// Response containing the organization's roles.
3093#[derive(Clone, PartialEq, ::prost::Message)]
3094pub struct ListRolesResponse {
3095    /// All roles in the organization, including their permission sets.
3096    #[prost(message, repeated, tag="1")]
3097    pub roles: ::prost::alloc::vec::Vec<Role>,
3098}
3099/// Request to create a new role in the caller's organization.
3100#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3101pub struct CreateRoleRequest {
3102    /// Display name for the role (e.g. "Team Lead"). Required.
3103    /// A slug is auto-generated from the name.
3104    #[prost(string, tag="1")]
3105    pub name: ::prost::alloc::string::String,
3106    /// Initial permission set for the role.
3107    /// PERMISSION_UNSPECIFIED values are rejected.
3108    #[prost(enumeration="Permission", repeated, tag="2")]
3109    pub permissions: ::prost::alloc::vec::Vec<i32>,
3110}
3111/// Response after creating a role.
3112#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3113pub struct CreateRoleResponse {
3114    /// The newly created role with its generated slug and permission set.
3115    #[prost(message, optional, tag="1")]
3116    pub role: ::core::option::Option<Role>,
3117}
3118/// Request to update a role's name and/or permissions.
3119#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3120pub struct UpdateRoleRequest {
3121    /// ID of the role to update. Required.
3122    #[prost(string, tag="1")]
3123    pub role_id: ::prost::alloc::string::String,
3124    /// New display name. If empty, the name is not changed.
3125    #[prost(string, tag="2")]
3126    pub name: ::prost::alloc::string::String,
3127    /// New permission set (replaces existing permissions entirely).
3128    /// If empty, permissions are not changed.
3129    /// PERMISSION_UNSPECIFIED values are rejected.
3130    #[prost(enumeration="Permission", repeated, tag="3")]
3131    pub permissions: ::prost::alloc::vec::Vec<i32>,
3132}
3133/// Response after updating a role.
3134#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3135pub struct UpdateRoleResponse {
3136    /// The updated role.
3137    #[prost(message, optional, tag="1")]
3138    pub role: ::core::option::Option<Role>,
3139}
3140/// Request to delete a role.
3141#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3142pub struct DeleteRoleRequest {
3143    /// ID of the role to delete. Required.
3144    #[prost(string, tag="1")]
3145    pub role_id: ::prost::alloc::string::String,
3146}
3147/// Response after deleting a role.
3148#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3149pub struct DeleteRoleResponse {
3150}
3151// ─── Messages ───────────────────────────────────────────────────────────────
3152
3153/// Custom SAML attribute name overrides for identity providers that use
3154/// non-standard attribute names. When provided, these override the
3155/// auto-detected values from the metadata URL host.
3156#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3157pub struct SamlAttributeNames {
3158    /// SAML attribute name for the user's email address.
3159    #[prost(string, tag="1")]
3160    pub email: ::prost::alloc::string::String,
3161    /// SAML attribute name for the user's first name.
3162    #[prost(string, tag="2")]
3163    pub given_name: ::prost::alloc::string::String,
3164    /// SAML attribute name for the user's last name.
3165    #[prost(string, tag="3")]
3166    pub family_name: ::prost::alloc::string::String,
3167}
3168/// An SSO identity provider configured for an organization.
3169#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3170pub struct SsoProvider {
3171    /// Unique identifier for the provider.
3172    #[prost(string, tag="1")]
3173    pub id: ::prost::alloc::string::String,
3174    /// Email domain that triggers this SSO provider (e.g. "acme.com").
3175    /// Constraints: Max length 253 characters (RFC 1035).
3176    #[prost(string, tag="2")]
3177    pub domain: ::prost::alloc::string::String,
3178    /// Type of identity provider.
3179    #[prost(enumeration="SsoProviderType", tag="3")]
3180    pub r#type: i32,
3181    /// SAML metadata URL or OIDC discovery URL.
3182    /// Constraints: Max length 2048 characters. HTTPS required.
3183    #[prost(string, tag="4")]
3184    pub metadata_url: ::prost::alloc::string::String,
3185    /// Name of the identity provider (used for signInWithRedirect).
3186    /// Set by the API when the IdP is created.
3187    #[prost(string, tag="5")]
3188    pub idp_provider_name: ::prost::alloc::string::String,
3189    /// Timestamp when the provider was created.
3190    #[prost(message, optional, tag="6")]
3191    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
3192    /// Timestamp when the provider was last updated.
3193    #[prost(message, optional, tag="7")]
3194    pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
3195    /// Optional custom SAML attribute name overrides.
3196    #[prost(message, optional, tag="8")]
3197    pub attribute_mapping: ::core::option::Option<SamlAttributeNames>,
3198}
3199/// Request to check if an email domain has SSO configured.
3200/// This RPC is pre-authentication — no JWT required.
3201#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3202pub struct CheckSsoByDomainRequest {
3203    /// Email address to check. The domain part is extracted.
3204    /// Constraints: Max length 254 characters (RFC 5321).
3205    #[prost(string, tag="1")]
3206    pub email: ::prost::alloc::string::String,
3207}
3208/// Response for SSO domain check.
3209#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3210pub struct CheckSsoByDomainResponse {
3211    /// Whether SSO is enabled for the email's domain.
3212    #[prost(bool, tag="1")]
3213    pub sso_enabled: bool,
3214    /// Identity provider name for signInWithRedirect.
3215    /// Empty if sso_enabled is false.
3216    #[prost(string, tag="2")]
3217    pub provider_name: ::prost::alloc::string::String,
3218}
3219/// Request to create an SSO provider for the organization.
3220#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3221pub struct CreateSsoProviderRequest {
3222    /// Email domain to associate (e.g. "acme.com").
3223    /// Constraints: Max length 253 characters (RFC 1035).
3224    #[prost(string, tag="1")]
3225    pub domain: ::prost::alloc::string::String,
3226    /// Type of identity provider.
3227    #[prost(enumeration="SsoProviderType", tag="2")]
3228    pub r#type: i32,
3229    /// SAML metadata URL or OIDC discovery URL.
3230    /// Constraints: Max length 2048 characters. HTTPS required.
3231    #[prost(string, tag="3")]
3232    pub metadata_url: ::prost::alloc::string::String,
3233    /// Optional custom SAML attribute name overrides.
3234    /// When omitted, attribute names are auto-detected from the metadata URL.
3235    #[prost(message, optional, tag="4")]
3236    pub attribute_mapping: ::core::option::Option<SamlAttributeNames>,
3237}
3238/// Response after creating an SSO provider.
3239#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3240pub struct CreateSsoProviderResponse {
3241    /// The newly created SSO provider.
3242    #[prost(message, optional, tag="1")]
3243    pub provider: ::core::option::Option<SsoProvider>,
3244}
3245/// Request to get the SSO provider for the organization.
3246/// Returns the provider if one is configured, or empty if not.
3247#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3248pub struct GetSsoProviderRequest {
3249}
3250/// Response containing the organization's SSO provider.
3251#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3252pub struct GetSsoProviderResponse {
3253    /// The organization's SSO provider, or null if not configured.
3254    #[prost(message, optional, tag="1")]
3255    pub provider: ::core::option::Option<SsoProvider>,
3256}
3257/// Request to delete the organization's SSO provider.
3258#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3259pub struct DeleteSsoProviderRequest {
3260    /// ID of the provider to delete.
3261    #[prost(string, tag="1")]
3262    pub provider_id: ::prost::alloc::string::String,
3263}
3264/// Response after deleting an SSO provider.
3265#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3266pub struct DeleteSsoProviderResponse {
3267}
3268// ─── Enums ──────────────────────────────────────────────────────────────────
3269
3270/// Type of SSO identity provider.
3271#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3272#[repr(i32)]
3273pub enum SsoProviderType {
3274    /// Default value; not a valid type.
3275    Unspecified = 0,
3276    /// SAML 2.0 identity provider (e.g. Okta, Azure AD).
3277    Saml = 1,
3278    /// OpenID Connect identity provider (e.g. Google Workspace, Auth0).
3279    Oidc = 2,
3280}
3281impl SsoProviderType {
3282    /// String value of the enum field names used in the ProtoBuf definition.
3283    ///
3284    /// The values are not transformed in any way and thus are considered stable
3285    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3286    pub fn as_str_name(&self) -> &'static str {
3287        match self {
3288            Self::Unspecified => "SSO_PROVIDER_TYPE_UNSPECIFIED",
3289            Self::Saml => "SSO_PROVIDER_TYPE_SAML",
3290            Self::Oidc => "SSO_PROVIDER_TYPE_OIDC",
3291        }
3292    }
3293    /// Creates an enum from field names used in the ProtoBuf definition.
3294    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3295        match value {
3296            "SSO_PROVIDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
3297            "SSO_PROVIDER_TYPE_SAML" => Some(Self::Saml),
3298            "SSO_PROVIDER_TYPE_OIDC" => Some(Self::Oidc),
3299            _ => None,
3300        }
3301    }
3302}
3303// ─── Messages ───────────────────────────────────────────────────────────────
3304
3305/// An organizational unit within an organization (e.g. department, division).
3306/// Teams represent the organizational structure and can serve as sender identity
3307/// in campaigns.
3308#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3309pub struct Team {
3310    /// Unique identifier for the team.
3311    #[prost(string, tag="1")]
3312    pub id: ::prost::alloc::string::String,
3313    /// Human-readable display name (unique within the organization).
3314    /// Constraints: Max length 200 characters.
3315    #[prost(string, tag="2")]
3316    pub name: ::prost::alloc::string::String,
3317    /// Optional description of the team's purpose.
3318    /// Constraints: Max length 1000 characters.
3319    #[prost(string, tag="3")]
3320    pub description: ::prost::alloc::string::String,
3321    /// Number of users currently in the team.
3322    #[prost(int32, tag="4")]
3323    pub member_count: i32,
3324    /// Timestamp when the team was created.
3325    #[prost(message, optional, tag="5")]
3326    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
3327    /// Timestamp when the team was last updated.
3328    #[prost(message, optional, tag="6")]
3329    pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
3330    /// Whether this is the organization's default team (cannot be deleted or renamed).
3331    #[prost(bool, tag="7")]
3332    pub is_default: bool,
3333    /// ID of the user who created this team. Empty for system-seeded defaults.
3334    #[prost(string, tag="8")]
3335    pub created_by: ::prost::alloc::string::String,
3336}
3337/// Request to create a new team.
3338#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3339pub struct CreateTeamRequest {
3340    /// Display name for the team. Required.
3341    /// Constraints: Max length 200 characters.
3342    #[prost(string, tag="1")]
3343    pub name: ::prost::alloc::string::String,
3344    /// Optional description.
3345    /// Constraints: Max length 1000 characters.
3346    #[prost(string, tag="2")]
3347    pub description: ::prost::alloc::string::String,
3348}
3349/// Response after creating a team.
3350#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3351pub struct CreateTeamResponse {
3352    /// The newly created team.
3353    #[prost(message, optional, tag="1")]
3354    pub team: ::core::option::Option<Team>,
3355}
3356/// Request to retrieve a team by ID.
3357#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3358pub struct GetTeamRequest {
3359    /// ID of the team to retrieve. Required.
3360    #[prost(string, tag="1")]
3361    pub team_id: ::prost::alloc::string::String,
3362}
3363/// Response containing the requested team.
3364#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3365pub struct GetTeamResponse {
3366    /// The requested team.
3367    #[prost(message, optional, tag="1")]
3368    pub team: ::core::option::Option<Team>,
3369}
3370/// Request to list teams in the organization with pagination.
3371#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3372pub struct ListTeamsRequest {
3373    /// Pagination parameters.
3374    #[prost(message, optional, tag="1")]
3375    pub pagination: ::core::option::Option<Pagination>,
3376}
3377/// Response containing a page of teams.
3378#[derive(Clone, PartialEq, ::prost::Message)]
3379pub struct ListTeamsResponse {
3380    /// Teams in this page.
3381    #[prost(message, repeated, tag="1")]
3382    pub teams: ::prost::alloc::vec::Vec<Team>,
3383    /// Pagination metadata for fetching subsequent pages.
3384    #[prost(message, optional, tag="2")]
3385    pub pagination_meta: ::core::option::Option<PaginationMeta>,
3386}
3387/// Request to update a team's name and/or description.
3388#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3389pub struct UpdateTeamRequest {
3390    /// ID of the team to update. Required.
3391    #[prost(string, tag="1")]
3392    pub team_id: ::prost::alloc::string::String,
3393    /// New display name. If empty, the name is not changed.
3394    /// Default teams cannot be renamed.
3395    /// Constraints: Max length 200 characters.
3396    #[prost(string, tag="2")]
3397    pub name: ::prost::alloc::string::String,
3398    /// New description. If empty, the description is not changed.
3399    /// Constraints: Max length 1000 characters.
3400    #[prost(string, tag="3")]
3401    pub description: ::prost::alloc::string::String,
3402}
3403/// Response after updating a team.
3404#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3405pub struct UpdateTeamResponse {
3406    /// The updated team.
3407    #[prost(message, optional, tag="1")]
3408    pub team: ::core::option::Option<Team>,
3409}
3410/// Request to delete a team.
3411#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3412pub struct DeleteTeamRequest {
3413    /// ID of the team to delete. Required.
3414    /// Default teams cannot be deleted.
3415    #[prost(string, tag="1")]
3416    pub team_id: ::prost::alloc::string::String,
3417}
3418/// Response after deleting a team.
3419#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3420pub struct DeleteTeamResponse {
3421}
3422/// Request to add users to a team.
3423#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3424pub struct AddTeamMembersRequest {
3425    /// ID of the team to add members to. Required.
3426    #[prost(string, tag="1")]
3427    pub team_id: ::prost::alloc::string::String,
3428    /// IDs of users to add. Must belong to the same organization.
3429    /// Adding an existing member is a no-op (idempotent).
3430    /// Constraints: Max 100 user IDs per request.
3431    #[prost(string, repeated, tag="2")]
3432    pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3433}
3434/// Response after adding team members.
3435#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3436pub struct AddTeamMembersResponse {
3437    /// The team with updated member_count.
3438    #[prost(message, optional, tag="1")]
3439    pub team: ::core::option::Option<Team>,
3440}
3441/// Request to remove users from a team.
3442#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3443pub struct RemoveTeamMembersRequest {
3444    /// ID of the team to remove members from. Required.
3445    #[prost(string, tag="1")]
3446    pub team_id: ::prost::alloc::string::String,
3447    /// IDs of users to remove. Removing a non-member is a no-op (idempotent).
3448    /// Constraints: Max 100 user IDs per request.
3449    #[prost(string, repeated, tag="2")]
3450    pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3451}
3452/// Response after removing team members.
3453#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3454pub struct RemoveTeamMembersResponse {
3455    /// The team with updated member_count.
3456    #[prost(message, optional, tag="1")]
3457    pub team: ::core::option::Option<Team>,
3458}
3459/// Request to list members of a team with pagination.
3460#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3461pub struct ListTeamMembersRequest {
3462    /// ID of the team whose members to list. Required.
3463    #[prost(string, tag="1")]
3464    pub team_id: ::prost::alloc::string::String,
3465    /// Pagination parameters.
3466    #[prost(message, optional, tag="2")]
3467    pub pagination: ::core::option::Option<Pagination>,
3468}
3469/// Response containing a page of team members.
3470#[derive(Clone, PartialEq, ::prost::Message)]
3471pub struct ListTeamMembersResponse {
3472    /// Users in this page.
3473    #[prost(message, repeated, tag="1")]
3474    pub users: ::prost::alloc::vec::Vec<User>,
3475    /// Pagination metadata for fetching subsequent pages.
3476    #[prost(message, optional, tag="2")]
3477    pub pagination_meta: ::core::option::Option<PaginationMeta>,
3478}
3479// ─── Messages ───────────────────────────────────────────────────────────────
3480
3481/// A variable placeholder within a template that gets substituted during rendering.
3482#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3483pub struct TemplateVariable {
3484    /// Variable name used in the template body (e.g. "employee_name").
3485    /// Constraints: Max length 100 characters.
3486    #[prost(string, tag="1")]
3487    pub name: ::prost::alloc::string::String,
3488    /// Human-readable description of what this variable represents.
3489    /// Constraints: Max length 500 characters.
3490    #[prost(string, tag="2")]
3491    pub description: ::prost::alloc::string::String,
3492    /// Whether this variable must be provided during rendering.
3493    #[prost(bool, tag="3")]
3494    pub required: bool,
3495    /// Where this variable's value comes from (profile attribute or campaign config).
3496    #[prost(enumeration="TemplateVariableSource", tag="4")]
3497    pub source: i32,
3498    /// Fallback value used when the source does not provide a value.
3499    /// Constraints: Max length 1000 characters.
3500    #[prost(string, tag="5")]
3501    pub default_value: ::prost::alloc::string::String,
3502    /// When true, this variable's rendered value is masked in session replay
3503    /// and heatmap screenshots. Org admin controls per variable.
3504    #[prost(bool, tag="6")]
3505    pub pii: bool,
3506}
3507/// A versioned message template with variable placeholders.
3508/// Templates are append-only — updates create new versions.
3509#[derive(Clone, PartialEq, ::prost::Message)]
3510pub struct Template {
3511    /// Unique identifier for the template.
3512    #[prost(string, tag="1")]
3513    pub id: ::prost::alloc::string::String,
3514    /// Human-readable template name (admin-facing label).
3515    /// Constraints: Max length 200 characters.
3516    #[prost(string, tag="2")]
3517    pub name: ::prost::alloc::string::String,
3518    /// Template body with {{variable}} placeholders for substitution.
3519    /// Constraints: Max length 50000 characters.
3520    #[prost(string, tag="3")]
3521    pub body: ::prost::alloc::string::String,
3522    /// Variables that can be substituted into the template body.
3523    #[prost(message, repeated, tag="4")]
3524    pub variables: ::prost::alloc::vec::Vec<TemplateVariable>,
3525    /// Version number (auto-incremented on each update).
3526    #[prost(int32, tag="5")]
3527    pub version: i32,
3528    /// Timestamp when this version was created.
3529    #[prost(message, optional, tag="6")]
3530    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
3531    /// Timestamp of the most recent update (same as created_at for the latest version).
3532    #[prost(message, optional, tag="7")]
3533    pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
3534    /// User-facing title shown as the message subject to recipients.
3535    /// Serves as the default title; campaigns can override it.
3536    /// Constraints: Max length 200 characters.
3537    #[prost(string, tag="8")]
3538    pub title: ::prost::alloc::string::String,
3539    /// Content format of this template (markdown, rich, HTML).
3540    /// UNSPECIFIED is treated as MARKDOWN for backward compatibility.
3541    #[prost(enumeration="TemplateType", tag="9")]
3542    pub r#type: i32,
3543}
3544/// Request to create a new template.
3545#[derive(Clone, PartialEq, ::prost::Message)]
3546pub struct CreateTemplateRequest {
3547    /// Human-readable template name (admin-facing label).
3548    /// Constraints: Max length 200 characters.
3549    #[prost(string, tag="1")]
3550    pub name: ::prost::alloc::string::String,
3551    /// Template body with {{variable}} placeholders.
3552    /// Constraints: Max length 50000 characters.
3553    #[prost(string, tag="2")]
3554    pub body: ::prost::alloc::string::String,
3555    /// Variables available for substitution in the body.
3556    #[prost(message, repeated, tag="3")]
3557    pub variables: ::prost::alloc::vec::Vec<TemplateVariable>,
3558    /// User-facing title shown as the message subject to recipients.
3559    /// Constraints: Max length 200 characters.
3560    #[prost(string, tag="4")]
3561    pub title: ::prost::alloc::string::String,
3562    /// Content format of the template. Defaults to MARKDOWN if unspecified.
3563    #[prost(enumeration="TemplateType", tag="5")]
3564    pub r#type: i32,
3565}
3566/// Response after creating a template.
3567#[derive(Clone, PartialEq, ::prost::Message)]
3568pub struct CreateTemplateResponse {
3569    /// The newly created template (version 1).
3570    #[prost(message, optional, tag="1")]
3571    pub template: ::core::option::Option<Template>,
3572}
3573/// Request to update a template, creating a new version.
3574#[derive(Clone, PartialEq, ::prost::Message)]
3575pub struct UpdateTemplateRequest {
3576    /// ID of the template to update.
3577    #[prost(string, tag="1")]
3578    pub template_id: ::prost::alloc::string::String,
3579    /// New template body with {{variable}} placeholders.
3580    /// Constraints: Max length 50000 characters.
3581    #[prost(string, tag="2")]
3582    pub body: ::prost::alloc::string::String,
3583    /// Updated variables for substitution.
3584    #[prost(message, repeated, tag="3")]
3585    pub variables: ::prost::alloc::vec::Vec<TemplateVariable>,
3586}
3587/// Response after updating a template.
3588#[derive(Clone, PartialEq, ::prost::Message)]
3589pub struct UpdateTemplateResponse {
3590    /// The updated template with incremented version number.
3591    #[prost(message, optional, tag="1")]
3592    pub template: ::core::option::Option<Template>,
3593}
3594/// Request to retrieve a specific template version.
3595#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3596pub struct GetTemplateRequest {
3597    /// ID of the template to retrieve.
3598    #[prost(string, tag="1")]
3599    pub template_id: ::prost::alloc::string::String,
3600    /// Version to retrieve. 0 returns the latest version.
3601    #[prost(int32, tag="2")]
3602    pub version: i32,
3603}
3604/// Response containing the requested template.
3605#[derive(Clone, PartialEq, ::prost::Message)]
3606pub struct GetTemplateResponse {
3607    /// The requested template.
3608    #[prost(message, optional, tag="1")]
3609    pub template: ::core::option::Option<Template>,
3610}
3611/// Request to list templates with pagination.
3612#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3613pub struct ListTemplatesRequest {
3614    /// Pagination parameters.
3615    #[prost(message, optional, tag="1")]
3616    pub pagination: ::core::option::Option<Pagination>,
3617    /// Filter by template type. UNSPECIFIED returns all templates.
3618    #[prost(enumeration="TemplateType", tag="2")]
3619    pub r#type: i32,
3620}
3621/// Response containing a page of templates.
3622#[derive(Clone, PartialEq, ::prost::Message)]
3623pub struct ListTemplatesResponse {
3624    /// List of templates in this page (latest version of each).
3625    #[prost(message, repeated, tag="1")]
3626    pub templates: ::prost::alloc::vec::Vec<Template>,
3627    /// Pagination metadata for fetching subsequent pages.
3628    #[prost(message, optional, tag="2")]
3629    pub pagination_meta: ::core::option::Option<PaginationMeta>,
3630}
3631// ─── Enums ──────────────────────────────────────────────────────────────────
3632
3633/// Content format of a template, determining which editor and renderer to use.
3634#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3635#[repr(i32)]
3636pub enum TemplateType {
3637    /// Default value; treated as MARKDOWN for backward compatibility.
3638    Unspecified = 0,
3639    /// Markdown with {{variable}} placeholders.
3640    Markdown = 1,
3641    /// Rich text format (reserved for future use).
3642    Rich = 2,
3643    /// Raw HTML format (reserved for future use).
3644    Html = 3,
3645}
3646impl TemplateType {
3647    /// String value of the enum field names used in the ProtoBuf definition.
3648    ///
3649    /// The values are not transformed in any way and thus are considered stable
3650    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3651    pub fn as_str_name(&self) -> &'static str {
3652        match self {
3653            Self::Unspecified => "TEMPLATE_TYPE_UNSPECIFIED",
3654            Self::Markdown => "TEMPLATE_TYPE_MARKDOWN",
3655            Self::Rich => "TEMPLATE_TYPE_RICH",
3656            Self::Html => "TEMPLATE_TYPE_HTML",
3657        }
3658    }
3659    /// Creates an enum from field names used in the ProtoBuf definition.
3660    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3661        match value {
3662            "TEMPLATE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
3663            "TEMPLATE_TYPE_MARKDOWN" => Some(Self::Markdown),
3664            "TEMPLATE_TYPE_RICH" => Some(Self::Rich),
3665            "TEMPLATE_TYPE_HTML" => Some(Self::Html),
3666            _ => None,
3667        }
3668    }
3669}
3670/// Source from which a template variable's value is resolved at render time.
3671#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3672#[repr(i32)]
3673pub enum TemplateVariableSource {
3674    /// Default value; treated as CUSTOM for backward compatibility.
3675    Unspecified = 0,
3676    /// Auto-resolved from the target user's profile attributes.
3677    Profile = 1,
3678    /// Provided manually in the campaign or workflow step configuration.
3679    Custom = 2,
3680}
3681impl TemplateVariableSource {
3682    /// String value of the enum field names used in the ProtoBuf definition.
3683    ///
3684    /// The values are not transformed in any way and thus are considered stable
3685    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3686    pub fn as_str_name(&self) -> &'static str {
3687        match self {
3688            Self::Unspecified => "TEMPLATE_VARIABLE_SOURCE_UNSPECIFIED",
3689            Self::Profile => "TEMPLATE_VARIABLE_SOURCE_PROFILE",
3690            Self::Custom => "TEMPLATE_VARIABLE_SOURCE_CUSTOM",
3691        }
3692    }
3693    /// Creates an enum from field names used in the ProtoBuf definition.
3694    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3695        match value {
3696            "TEMPLATE_VARIABLE_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
3697            "TEMPLATE_VARIABLE_SOURCE_PROFILE" => Some(Self::Profile),
3698            "TEMPLATE_VARIABLE_SOURCE_CUSTOM" => Some(Self::Custom),
3699            _ => None,
3700        }
3701    }
3702}
3703include!("pidgr.v1.tonic.rs");
3704// @@protoc_insertion_point(module)