def METHOD_NAME(self, organization, data, actor=None):
    if actor is None:
        raise NotImplementedError("Cannot create a repository anonymously")
    client = self.get_client(actor)
    try:
        resp = client.create_hook(
            data["name"],
            {
                "description": "sentry-bitbucket-repo-hook",
                "url": absolute_uri(
                    f"/plugins/bitbucket/organizations/{organization.id}/webhook/"
                ),
                "active": True,
                "events": ["repo:push"],
            },
        )
    except Exception as e:
        self.raise_error(e, identity=client.auth)
    else:
        return {
            "name": data["name"],
            "external_id": data["external_id"],
            "url": "https://bitbucket.org/{}".format(data["name"]),
            "config": {"name": data["name"], "webhook_id": resp["uuid"]},
        }