@@ -275,25 +275,41 @@ pub enum StraightThroughAlgorithm {
275
275
Single ( api_enums:: RoutableConnectors ) ,
276
276
}
277
277
278
+ #[ derive( Clone , Debug , Deserialize , Serialize ) ]
279
+ #[ serde( tag = "type" , content = "data" , rename_all = "snake_case" ) ]
280
+ pub enum StraightThroughAlgorithmInner {
281
+ Single ( api_enums:: RoutableConnectors ) ,
282
+ }
283
+
278
284
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
279
285
#[ serde( untagged) ]
280
286
pub enum StraightThroughAlgorithmSerde {
281
- Direct ( StraightThroughAlgorithm ) ,
282
- Nested { algorithm : StraightThroughAlgorithm } ,
287
+ Direct ( StraightThroughAlgorithmInner ) ,
288
+ Nested {
289
+ algorithm : StraightThroughAlgorithmInner ,
290
+ } ,
283
291
}
284
292
285
293
impl From < StraightThroughAlgorithmSerde > for StraightThroughAlgorithm {
286
294
fn from ( value : StraightThroughAlgorithmSerde ) -> Self {
287
- match value {
295
+ let inner = match value {
288
296
StraightThroughAlgorithmSerde :: Direct ( algorithm) => algorithm,
289
297
StraightThroughAlgorithmSerde :: Nested { algorithm } => algorithm,
298
+ } ;
299
+
300
+ match inner {
301
+ StraightThroughAlgorithmInner :: Single ( conn) => Self :: Single ( conn) ,
290
302
}
291
303
}
292
304
}
293
305
294
306
impl From < StraightThroughAlgorithm > for StraightThroughAlgorithmSerde {
295
307
fn from ( value : StraightThroughAlgorithm ) -> Self {
296
- Self :: Nested { algorithm : value }
308
+ let inner = match value {
309
+ StraightThroughAlgorithm :: Single ( conn) => StraightThroughAlgorithmInner :: Single ( conn) ,
310
+ } ;
311
+
312
+ Self :: Nested { algorithm : inner }
297
313
}
298
314
}
299
315
0 commit comments