from owsclient import OwsClient from pydantic import BaseModel, Field class UpsertAudienceFansResponse(BaseModel): fan_count: int = Field(alias="fanCount") class OwsDmpClient: service_name = "ows-dmp" def __init__(self, ows_client: OwsClient) -> None: self.ows_client = ows_client def upsert_audience_fans(self, audience_id: str) -> int: response = self.ows_client.post( self.service_name, f"/audiences/{audience_id}/fans/upsert", timeout=15.0 ) response_obj = UpsertAudienceFansResponse.model_validate_json(response.content) return response_obj.fan_count