@@ -782,30 +782,75 @@ def _get_dynamic_config_value(
782
782
return res .val ()
783
783
784
784
def get_bool (self , feature_name : str , default : bool = False ) -> bool :
785
+ """Fetch a Dynamic Configuration of boolean type.
786
+
787
+ :param feature_name: Name of the dynamic config you want a value for.
788
+
789
+ :param default: what is returned if dynamic config is not active
790
+ (:code:`False` unless overriden).
791
+
792
+ :return: the boolean value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
793
+ """
785
794
decider = self ._get_decider ()
786
795
if not decider :
787
796
return default
788
797
return self ._get_dynamic_config_value (feature_name , decider .get_bool , default )
789
798
790
799
def get_int (self , feature_name : str , default : int = 0 ) -> int :
800
+ """Fetch a Dynamic Configuration of int type.
801
+
802
+ :param feature_name: Name of the dynamic config you want a value for.
803
+
804
+ :param default: what is returned if dynamic config is not active
805
+ (:code:`0` unless overriden).
806
+
807
+ :return: the int value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
808
+ """
791
809
decider = self ._get_decider ()
792
810
if not decider :
793
811
return default
794
812
return self ._get_dynamic_config_value (feature_name , decider .get_int , default )
795
813
796
814
def get_float (self , feature_name : str , default : float = 0.0 ) -> float :
815
+ """Fetch a Dynamic Configuration of float type.
816
+
817
+ :param feature_name: Name of the dynamic config you want a value for.
818
+
819
+ :param default: what is returned if dynamic config is not active
820
+ (:code:`0.0` unless overriden).
821
+
822
+ :return: the float value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
823
+ """
797
824
decider = self ._get_decider ()
798
825
if not decider :
799
826
return default
800
827
return self ._get_dynamic_config_value (feature_name , decider .get_float , default )
801
828
802
829
def get_string (self , feature_name : str , default : str = "" ) -> str :
830
+ """Fetch a Dynamic Configuration of string type.
831
+
832
+ :param feature_name: Name of the dynamic config you want a value for.
833
+
834
+ :param default: what is returned if dynamic config is not active
835
+ (:code:`""` unless overriden).
836
+
837
+ :return: the string value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
838
+ """
803
839
decider = self ._get_decider ()
804
840
if not decider :
805
841
return default
806
842
return self ._get_dynamic_config_value (feature_name , decider .get_string , default )
807
843
808
844
def get_map (self , feature_name : str , default : Optional [dict ] = None ) -> Optional [dict ]:
845
+ """Fetch a Dynamic Configuration of map type.
846
+
847
+ :param feature_name: Name of the dynamic config you want a value for.
848
+
849
+ :param default: what is returned if dynamic config is not active
850
+ (:code:`None` unless overriden).
851
+
852
+ :return: the map value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
853
+ """
809
854
decider = self ._get_decider ()
810
855
if not decider :
811
856
return default
0 commit comments