33
44from datetime import datetime
55from importlib .util import find_spec
6- from typing import Optional , Union
6+ from typing import Any , Optional , Union
77
88from gooddata_api_client .model .inline_filter_definition_inline import InlineFilterDefinitionInline
99
@@ -510,10 +510,10 @@ def description(self, labels: dict[str, str], format_locale: Optional[str] = Non
510510class InlineFilter (Filter ):
511511 """Filter using a custom MAQL expression.
512512
513- Automatically decides, whether to create or update.
513+ Automatically decides, whether to create or update.
514514
515- Args:
516- maql (str): The MAQL expression string that defines the filter condition.
515+ Args:
516+ maql (str): The MAQL expression string that defines the filter condition.
517517
518518 Example:
519519 ```python
@@ -529,14 +529,22 @@ class InlineFilter(Filter):
529529 ```
530530 """
531531
532- def __init__ (self , maql : str ):
533- super ().__init__ ()
532+ def __init__ (
533+ self , maql : str , apply_on_result : Optional [bool ] = None , local_identifier : Optional [Union [ObjId , str ]] = None
534+ ) -> None :
535+ super ().__init__ (apply_on_result )
534536
535537 self .maql = maql
538+ self .local_identifier = local_identifier
536539
537540 def is_noop (self ) -> bool :
538541 return False
539542
540543 def as_api_model (self ) -> afm_models .InlineFilterDefinition :
541- body = InlineFilterDefinitionInline (self .maql )
544+ kwargs : dict [str , Any ] = {}
545+ if self .apply_on_result is not None :
546+ kwargs ["apply_on_result" ] = self .apply_on_result
547+ if self .local_identifier is not None :
548+ kwargs ["local_identifier" ] = str (self .local_identifier )
549+ body = InlineFilterDefinitionInline (self .maql , ** kwargs )
542550 return afm_models .InlineFilterDefinition (body , _check_type = False )
0 commit comments