@@ -13,14 +13,20 @@ use crate::{
1313pub struct ActionForms {
1414 pub id : String ,
1515 pub name : String ,
16- pub forms : Vec < ActionProviderForm > ,
16+ pub method_forms : Vec < ActionMethodForm > ,
17+ }
18+
19+ // TODO: Think of a better name.
20+ #[ derive( Clone , Debug , Deserialize , PartialEq , Serialize ) ]
21+ pub struct ActionMethodForm {
22+ pub id : String ,
23+ pub provider_forms : Vec < ActionProviderForm > ,
1724}
1825
1926// TODO: Think of a better name.
2027#[ derive( Clone , Debug , Deserialize , PartialEq , Serialize ) ]
2128pub struct ActionProviderForm {
22- pub method_id : String ,
23- pub provider_id : Option < String > ,
29+ pub id : Option < String > ,
2430 pub form : Form ,
2531}
2632
@@ -34,7 +40,7 @@ pub trait Action<P: Provider>: ErasedAction + Send + Sync {
3440 Ok ( true )
3541 }
3642
37- fn form ( & self , provider : P ) -> Form ;
43+ fn forms ( & self , provider : P ) -> Vec < Form > ;
3844
3945 async fn call (
4046 & self ,
@@ -56,7 +62,7 @@ pub trait ErasedAction: Send + Sync {
5662 session : Session ,
5763 ) -> Result < bool , ShieldError > ;
5864
59- fn erased_form ( & self , provider : Box < dyn Any + Send + Sync > ) -> Form ;
65+ fn erased_forms ( & self , provider : Box < dyn Any + Send + Sync > ) -> Vec < Form > ;
6066
6167 async fn erased_call (
6268 & self ,
@@ -83,8 +89,8 @@ macro_rules! erased_action {
8389 self . condition( provider. downcast_ref( ) . expect( "TODO" ) , session)
8490 }
8591
86- fn erased_form ( & self , provider: Box <dyn std:: any:: Any + Send + Sync >) -> $crate:: Form {
87- self . form ( * provider. downcast( ) . expect( "TODO" ) )
92+ fn erased_forms ( & self , provider: Box <dyn std:: any:: Any + Send + Sync >) -> Vec < $crate:: Form > {
93+ self . forms ( * provider. downcast( ) . expect( "TODO" ) )
8894 }
8995
9096 async fn erased_call(
0 commit comments