def get_company_by_domain(self, domain: str) -> dict[str, Any] | None:
        """
        Domain should be unique in Hubspot by design, so we should only ever have
        0 or 1 results.
        """
        public_object_search_request = PublicObjectSearchRequest(
            filter_groups=[
                {
                    "filters": [
                        {"value": domain, "propertyName": "domain", "operator": "EQ"}
                    ]
                }
            ]
        )

        response = self.client.crm.companies.search_api.do_search(
            public_object_search_request=public_object_search_request,
        )

        results = response.to_dict()["results"]
        if not results:
            return None

        if len(results) > 1:
            logger.error("Multiple companies exist in Hubspot for domain %s.", domain)

        return results[0]  # type: ignore[no-any-return]

        Domain should be unique in Hubspot by design, so we should only ever have
        0 or 1 results.
        
api/integrations/lead_tracking/hubspot/client.py