22#[ allow( unused) ]
33pub use crate :: gcp_triggers_ee:: * ;
44
5+ use serde_json:: value:: RawValue ;
6+ use sqlx:: prelude:: FromRow ;
7+ use serde:: { Deserialize , Serialize } ;
8+ use std:: collections:: HashMap ;
9+ use sqlx:: types:: Json as SqlxJson ;
10+ use windmill_common:: worker:: to_raw_value;
11+ use windmill_common:: triggers:: TriggerKind ;
12+ use crate :: trigger_helpers:: TriggerJobArgs ;
13+
514#[ cfg( not( feature = "private" ) ) ]
615use {
716 crate :: db:: { ApiAuthed , DB } ,
8- crate :: trigger_helpers:: TriggerJobArgs ,
917 axum:: { extract:: Request , Router } ,
1018 http:: HeaderMap ,
11- serde:: { Deserialize , Serialize } ,
12- serde_json:: value:: RawValue ,
13- sqlx:: prelude:: FromRow ,
14- sqlx:: types:: Json as SqlxJson ,
15- std:: collections:: HashMap ,
1619 windmill_common:: db:: UserDB ,
17- windmill_common:: worker:: to_raw_value,
1820 windmill_common:: {
1921 error:: { Error as WindmillError , Result as WindmillResult } ,
20- triggers:: TriggerKind ,
2122 utils:: empty_as_none,
2223 } ,
2324} ;
@@ -134,7 +135,6 @@ pub fn gcp_push_route_handler() -> Router {
134135}
135136
136137#[ derive( FromRow , Deserialize , Serialize , Debug ) ]
137- #[ cfg( not( feature = "private" ) ) ]
138138pub struct GcpTrigger {
139139 pub gcp_resource_path : String ,
140140 pub subscription_id : String ,
@@ -163,7 +163,7 @@ pub struct GcpTrigger {
163163 #[ serde( skip_serializing_if = "Option::is_none" ) ]
164164 pub auto_acknowledge_msg : Option < bool > ,
165165}
166- # [ cfg ( not ( feature = "private" ) ) ]
166+
167167impl TriggerJobArgs < String > for GcpTrigger {
168168 fn v1_payload_fn ( payload : String ) -> HashMap < String , Box < RawValue > > {
169169 HashMap :: from ( [ ( "payload" . to_string ( ) , to_raw_value ( & payload) ) ] )
@@ -172,4 +172,4 @@ impl TriggerJobArgs<String> for GcpTrigger {
172172 fn trigger_kind ( ) -> TriggerKind {
173173 TriggerKind :: Gcp
174174 }
175- }
175+ }
0 commit comments