def METHOD_NAME(
    cls, v: Optional[DatahubClientConfig], values: Dict[str, Any], **kwargs: Any
) -> Optional[DatahubClientConfig]:
    if v is None and "sink" in values and hasattr(values["sink"], "type"):
        sink_type = values["sink"].type
        if sink_type == "datahub-rest":
            sink_config = values["sink"].config
            v = DatahubClientConfig.parse_obj_allow_extras(sink_config)
    return v