controller.utilities.configuration.CustomConfigurationModel.model_dump

CustomConfigurationModel.model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, round_trip=False, warnings=True, serialize_as_any=False)

Usage docs: https://docs.pydantic.dev/2.7/concepts/serialization/#modelmodel_dump

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Union[Literal['json', 'python'], str], default: 'python') – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include (Union[Set[int], Set[str], Dict[int, Any], Dict[str, Any], None], default: None) – A set of fields to include in the output.

  • exclude (Union[Set[int], Set[str], Dict[int, Any], Dict[str, Any], None], default: None) – A set of fields to exclude from the output.

  • context (dict[str, Any] | None, default: None) – Additional context to pass to the serializer.

  • by_alias (bool, default: False) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool, default: False) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool, default: False) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool, default: False) – Whether to exclude fields that have a value of None.

  • round_trip (bool, default: False) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (Union[bool, Literal['none', 'warn', 'error']], default: True) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • serialize_as_any (bool, default: False) – Whether to serialize fields with duck-typing serialization behavior.

Return type:

dict[str, Any]

Returns:

A dictionary representation of the model.