def METHOD_NAME(self) -> discovery.Resource:
    """Initialize the client."""
    if not self.api_key:
        raise PerspectiveAPIClientCredentialsError("API key was not set in credentials.conf")
    try:
        return discovery.build(
            "commentanalyzer",
            "v1alpha1",
            developerKey=self.api_key,
            discoveryServiceUrl="https://commentanalyzer.googleapis.com/$discovery/rest?version=v1alpha1",
            static_discovery=False,
        )
    except DefaultCredentialsError as e:
        raise PerspectiveAPIClientCredentialsError(
            f"Credentials error when creating Perspective API client: {e}"
        ) from e