kumo_api_types/rebind.rs
1use serde::{Deserialize, Serialize};
2use std::collections::HashMap;
3use utoipa::{ToResponse, ToSchema};
4
5/// Describes which messages should be rebound.
6/// The criteria apply to the scheduled queue associated
7/// with a given message.
8#[derive(Serialize, Deserialize, Debug, ToSchema)]
9pub struct RebindV1Request {
10 /// The campaign name to match. If omitted, any campaign will match.
11 #[serde(default)]
12 pub campaign: Option<String>,
13
14 /// The tenant to match. If omitted, any tenant will match.
15 #[serde(default)]
16 pub tenant: Option<String>,
17
18 /// The domain name to match. If omitted, any domain will match.
19 #[serde(default)]
20 #[schema(example = "example.com")]
21 pub domain: Option<String>,
22
23 /// The routing_domain name to match. If omitted, any routing_domain will match.
24 #[serde(default)]
25 pub routing_domain: Option<String>,
26
27 /// Reason to log in the delivery log. Each matching message will log
28 /// with an AdminRebind record unless you suppress logging.
29 #[schema(example = "Cleaning up a bad send")]
30 pub reason: String,
31
32 /// If true, do not generate AdminRebind delivery logs for matching
33 /// messages.
34 #[serde(default)]
35 pub suppress_logging: bool,
36
37 /// The data, a json object with string keys AND values to pass to the
38 /// rebind operation
39 // Currently limited to String values due to inability to implicitly
40 // convert serde_json::Value -> mlua::Value in the mlua bindings
41 pub data: HashMap<String, String>,
42
43 /// If true, a `rebind` event will be triggered and passed each
44 /// message and the supplied data.
45 /// If false, no event will be triggered and each field in data
46 /// will be applied to the msg metadata, overwriting any previous
47 /// value for that key.
48 #[serde(default)]
49 pub trigger_rebind_event: bool,
50
51 /// If true, make all matched messages immediately eligible for
52 /// delivery. When false, (the default), only messages whose
53 /// queue has changed will be made immediately eligible.
54 #[serde(default)]
55 pub always_flush: bool,
56}
57
58#[derive(Serialize, Deserialize, Debug, ToSchema, ToResponse)]
59pub struct RebindV1Response {}