@@ -232,13 +232,15 @@ impl DeploymentInfo {
232232pub  enum  AlertType  { 
233233    Threshold , 
234234    Anomaly , 
235+     Forecast , 
235236} 
236237
237238impl  Display  for  AlertType  { 
238239    fn  fmt ( & self ,  f :  & mut  fmt:: Formatter < ' _ > )  -> fmt:: Result  { 
239240        match  self  { 
240241            AlertType :: Threshold  => write ! ( f,  "threshold" ) , 
241242            AlertType :: Anomaly  => write ! ( f,  "anomaly" ) , 
243+             AlertType :: Forecast  => write ! ( f,  "forecast" ) , 
242244        } 
243245    } 
244246} 
@@ -1358,6 +1360,8 @@ pub enum AlertError {
13581360    InvalidQueryParameter , 
13591361    #[ error( "{0}" ) ]  
13601362    ArrowError ( #[ from]   ArrowError ) , 
1363+     #[ error( "Upgrade to Parseable Enterprise for {0} type alerts" ) ]  
1364+     NotPresentInOSS ( String ) , 
13611365} 
13621366
13631367impl  actix_web:: ResponseError  for  AlertError  { 
@@ -1382,6 +1386,7 @@ impl actix_web::ResponseError for AlertError {
13821386            Self :: InvalidAlertQuery  => StatusCode :: BAD_REQUEST , 
13831387            Self :: InvalidQueryParameter  => StatusCode :: BAD_REQUEST , 
13841388            Self :: ArrowError ( _)  => StatusCode :: INTERNAL_SERVER_ERROR , 
1389+             Self :: NotPresentInOSS ( _)  => StatusCode :: BAD_REQUEST , 
13851390        } 
13861391    } 
13871392
@@ -1462,7 +1467,12 @@ impl AlertManagerTrait for Alerts {
14621467                } 
14631468                AlertType :: Anomaly  => { 
14641469                    return  Err ( anyhow:: Error :: msg ( 
1465-                         "Get Parseable Enterprise for Anomaly alerts" , 
1470+                         AlertError :: NotPresentInOSS ( "anomaly" . into ( ) ) . to_string ( ) , 
1471+                     ) ) ; 
1472+                 } 
1473+                 AlertType :: Forecast  => { 
1474+                     return  Err ( anyhow:: Error :: msg ( 
1475+                         AlertError :: NotPresentInOSS ( "forecast" . into ( ) ) . to_string ( ) , 
14661476                    ) ) ; 
14671477                } 
14681478            } ; 
0 commit comments