Skip to main content

pidgr_proto/pidgr/v1/
pidgr.v1.rs

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