コード例 #1
0
    def apply_custom_endpoint_params(self):
        custom_endpoint = Utilities.dict_lookup(self.settings_custom, "endpoints", self.custom_endpoint_name)
        if custom_endpoint:
            if custom_endpoint.get("parameters"):
                Utilities.dict_nested_add(self.settings, {}, "endpoints", self.actual_endpoint_name, "parameters")

                for key, value in custom_endpoint["parameters"].items():
                    self.settings["endpoints"][self.actual_endpoint_name]["parameters"][key] = value

            if custom_endpoint.get("output"):
                Utilities.dict_nested_add(self.settings, {}, "endpoints", self.actual_endpoint_name, "output")

                for key, value in custom_endpoint["output"].items():
                    self.settings["endpoints"][self.actual_endpoint_name]["output"][key] = value

            if custom_endpoint.get("limit") is not None:
                Utilities.dict_nested_add(
                    self.settings, custom_endpoint["limit"], "endpoints", self.actual_endpoint_name, "limit"
                )

            if custom_endpoint.get("paging") is not None:
                Utilities.dict_nested_add(
                    self.settings, custom_endpoint["paging"], "endpoints", self.actual_endpoint_name, "paging"
                )