Return integration settings with *key* updated.
(
state: dict[str, Any],
key: str,
integration: Any,
*,
script_type: str | None = None,
raw_options: str | None = None,
parsed_options: dict[str, Any] | None = None,
)
| 39 | |
| 40 | |
| 41 | def with_integration_setting( |
| 42 | state: dict[str, Any], |
| 43 | key: str, |
| 44 | integration: Any, |
| 45 | *, |
| 46 | script_type: str | None = None, |
| 47 | raw_options: str | None = None, |
| 48 | parsed_options: dict[str, Any] | None = None, |
| 49 | ) -> dict[str, dict[str, Any]]: |
| 50 | """Return integration settings with *key* updated.""" |
| 51 | settings = integration_settings(state) |
| 52 | current = dict(settings.get(key, {})) |
| 53 | |
| 54 | if script_type: |
| 55 | current["script"] = script_type |
| 56 | if raw_options is not None: |
| 57 | current["raw_options"] = raw_options |
| 58 | elif "raw_options" in current and not current.get("raw_options"): |
| 59 | current.pop("raw_options", None) |
| 60 | |
| 61 | if parsed_options is not None: |
| 62 | current["parsed_options"] = parsed_options |
| 63 | elif raw_options is not None: |
| 64 | current.pop("parsed_options", None) |
| 65 | |
| 66 | current["invoke_separator"] = integration.effective_invoke_separator(parsed_options) |
| 67 | settings[key] = current |
| 68 | return settings |
| 69 | |
| 70 | |
| 71 | def invoke_separator_for_integration( |
nothing calls this directly
no test coverage detected