def update_flag(self, state: str, feature_key: str) \
        -> launchdarkly_api.FeatureFlag:
        """
        Update the flag status for the specified feature flag.

        :param state: New feature flag state
        :param featureKey: Feature flag key

        :returns: FeatureFlag object.
        """
        build_env = "/environments/" + self.environment_key + "/on"
        patch_comment = [{"op": "replace", "path": build_env, "value": state}]

        try:
            resp = self.feature.patch_feature_flag(
                self.project_key, feature_key, patch_comment)
        except launchdarkly_api.rest.ApiException as ex:
            msg = "Unable to update flag."
            resp = "API response was {0} {1}.".format(ex.status, ex.reason)
            LOG.error("%s %s", msg, resp)
            sys.exit(1)

        return resp
def update_flag ( self , state : str , feature_key : str ) -> launchdarkly_api . FeatureFlag : build_env = "/environments/" + self . environment_key + "/on" patch_comment = [ { "op" : "replace" , "path" : build_env , "value" : state } ] try : resp = self . feature . patch_feature_flag ( self . project_key , feature_key , patch_comment ) except launchdarkly_api . rest . ApiException as ex : msg = "Unable to update flag." resp = "API response was {0} {1}." . format ( ex . status , ex . reason ) LOG . error ( "%s %s" , msg , resp ) sys . exit ( 1 ) return resp
Update the flag status for the specified feature flag.

        :param state: New feature flag state
        :param featureKey: Feature flag key

        :returns: FeatureFlag object.