Skip to content

Urls

API models for the urls endpoint.

EditWebsiteRequest

A model request to ravyapi.api.endpoints.urls.URLs.edit_website.

Parameters

is_fraudulent: bool Whether the website is fraudulent. message: str An informational message about the website.

Attributes

is_fraudulent: bool Whether the website is fraudulent. message: str An informational message about the website.

Source code in ravyapi/api/models/urls.py
class EditWebsiteRequest:
    """A model request to `ravyapi.api.endpoints.urls.URLs.edit_website`.

    Parameters
    ----------
    is_fraudulent: bool
        Whether the website is fraudulent.
    message: str
        An informational message about the website.

    Attributes
    ----------
    is_fraudulent: bool
        Whether the website is fraudulent.
    message: str
        An informational message about the website.
    """

    __slots__: tuple[str, ...] = ("_is_fraudulent", "_message")

    def __init__(self, is_fraudulent: bool, message: str) -> None:
        """
        Parameters
        ----------
        is_fraudulent: bool
            Whether the website is fraudulent.
        message: str
            An informational message about the website.
        """
        self._is_fraudulent: bool = is_fraudulent
        self._message: str = message

    def __repr__(self) -> str:
        return (
            f"{self.__class__.__module__}.{self.__class__.__qualname__}"
            f"(is_fraudulent={self.is_fraudulent!r}, message={self.message!r})"
        )

    @property
    def is_fraudulent(self) -> bool:
        """Whether the website is fraudulent."""
        return self._is_fraudulent

    @property
    def message(self) -> str:
        """An informational message about the website."""
        return self._message

    def to_json(self) -> dict[str, Any]:
        """Returns a JSON representation of the model.

        Returns
        -------
        dict[str, Any]
            A JSON representation of the model.
        """
        return {
            "isFraudulent": self.is_fraudulent,
            "message": self.message,
        }

is_fraudulent: bool property

Whether the website is fraudulent.

message: str property

An informational message about the website.

__init__(is_fraudulent, message)

Parameters

is_fraudulent: bool Whether the website is fraudulent. message: str An informational message about the website.

Source code in ravyapi/api/models/urls.py
def __init__(self, is_fraudulent: bool, message: str) -> None:
    """
    Parameters
    ----------
    is_fraudulent: bool
        Whether the website is fraudulent.
    message: str
        An informational message about the website.
    """
    self._is_fraudulent: bool = is_fraudulent
    self._message: str = message

to_json()

Returns a JSON representation of the model.

Returns

dict[str, Any] A JSON representation of the model.

Source code in ravyapi/api/models/urls.py
def to_json(self) -> dict[str, Any]:
    """Returns a JSON representation of the model.

    Returns
    -------
    dict[str, Any]
        A JSON representation of the model.
    """
    return {
        "isFraudulent": self.is_fraudulent,
        "message": self.message,
    }

GetWebsiteResponse

A model response from ravyapi.api.endpoints.urls.URLs.get_website.

Attributes

data: dict[str, Any] The raw data returned from the Ravy API. is_fraudulent: bool Whether the website is fraudulent. message: str An informational message about the website.

Source code in ravyapi/api/models/urls.py
class GetWebsiteResponse:
    """A model response from `ravyapi.api.endpoints.urls.URLs.get_website`.

    Attributes
    ----------
    data: dict[str, Any]
        The raw data returned from the Ravy API.
    is_fraudulent: bool
        Whether the website is fraudulent.
    message: str
        An informational message about the website.
    """

    __slots__: tuple[str, ...] = ("_data", "_is_fraudulent", "_message")

    def __init__(self, data: dict[str, Any]) -> None:
        self._data: dict[str, Any] = data
        self._is_fraudulent: bool = data["isFraudulent"]
        self._message: str = data["message"]

    def __repr__(self) -> str:
        return (
            f"{self.__class__.__module__}.{self.__class__.__qualname__}"
            f"(is_fraudulent={self.is_fraudulent!r}, message={self.message!r})"
        )

    @property
    def data(self) -> dict[str, Any]:
        """The raw data returned from the Ravy API."""
        return self._data

    @property
    def is_fraudulent(self) -> bool:
        """Whether the website is fraudulent."""
        return self._is_fraudulent

    @property
    def message(self) -> str:
        """An informational message about the website."""
        return self._message

data: dict[str, Any] property

The raw data returned from the Ravy API.

is_fraudulent: bool property

Whether the website is fraudulent.

message: str property

An informational message about the website.