langchain/document_loaders/confluence.py/ConfluenceLoader/validate_init_args
class ConfluenceLoader:    def validate_init_args(
        url: Optional[str] = None,
        api_key: Optional[str] = None,
        username: Optional[str] = None,
        oauth2: Optional[dict] = None,
    ) -> Union[List, None]:
        """Validates proper combinations of init arguments"""

        errors = []
        if url is None:
            errors.append("Must provide `base_url`")

        if (api_key and not username) or (username and not api_key):
            errors.append(
                "If one of `api_key` or `username` is provided, "
                "the other must be as well."
            )

        if (api_key or username) and oauth2:
            errors.append(
                "Cannot provide a value for `api_key` and/or "
                "`username` and provide a value for `oauth2`"
            )

        if oauth2 and oauth2.keys() != [
            "access_token",
            "access_token_secret",
            "consumer_key",
            "key_cert",
        ]:
            errors.append(
                "You have either ommited require keys or added extra "
                "keys to the oauth2 dictionary. key values should be "
                "`['access_token', 'access_token_secret', 'consumer_key', 'key_cert']`"
            )

        if errors:
            return errors
        return None