Skip to content

Instantly share code, notes, and snippets.

@ptdecker
Created July 15, 2025 14:08
Show Gist options
  • Save ptdecker/9bf90846f2d2e0b54ac9729c487efaa1 to your computer and use it in GitHub Desktop.
Save ptdecker/9bf90846f2d2e0b54ac9729c487efaa1 to your computer and use it in GitHub Desktop.
Invalid type mismatch
#[derive(Debug, Serialize, Deserialize)]
pub struct ConsumerRequest {
/// The unique identifier for the consumer record. This parameter is optional and only used
/// when updating or deleting a consumer record.
#[cfg(feature = "string-consumer-id")]
pub consumer_id: Option<String>,
#[cfg(not(feature = "string-consumer-id"))]
pub consumer_id: Option<Uuid>,
pub organization_id: Option<String>,
trace_id: Option<Uuid>,
trace: Option<EventTraceMap>,
}
impl Default for ConsumerRequest {
fn default() -> Self {
let consumer_id = ConsumerId::new().id;
Self {
consumer_id: Some(consumer_id),
organization_id: None,
trace_id: Some(Uuid::new_v4()),
trace: None,
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment