Skip to content

Commit f7777a9

Browse files
committed
chore(client): add exclude_archived parameter to get_advertiser_campaigns method
1 parent b0f30db commit f7777a9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

rtbhouse_sdk/client.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def get_offers(self, adv_hash: str) -> list[schema.Offer]:
145145
data = self._get_list_of_dicts(f"/advertisers/{adv_hash}/offers")
146146
return [schema.Offer(**offer) for offer in data]
147147

148-
def get_advertiser_campaigns(self, adv_hash: str) -> list[schema.Campaign]:
149-
data = self._get_list_of_dicts(f"/advertisers/{adv_hash}/campaigns")
148+
def get_advertiser_campaigns(self, adv_hash: str, exclude_archived: bool = False) -> list[schema.Campaign]:
149+
data = self._get_list_of_dicts(f"/advertisers/{adv_hash}/campaigns", {"excludeArchived": exclude_archived})
150150
return [schema.Campaign(**camp) for camp in data]
151151

152152
def get_billing(
@@ -332,8 +332,10 @@ async def get_offers(self, adv_hash: str) -> list[schema.Offer]:
332332
data = await self._get_list_of_dicts(f"/advertisers/{adv_hash}/offers")
333333
return [schema.Offer(**offer) for offer in data]
334334

335-
async def get_advertiser_campaigns(self, adv_hash: str) -> list[schema.Campaign]:
336-
data = await self._get_list_of_dicts(f"/advertisers/{adv_hash}/campaigns")
335+
async def get_advertiser_campaigns(self, adv_hash: str, exclude_archived: bool = False) -> list[schema.Campaign]:
336+
data = await self._get_list_of_dicts(
337+
f"/advertisers/{adv_hash}/campaigns", {"excludeArchived": exclude_archived}
338+
)
337339
return [schema.Campaign(**camp) for camp in data]
338340

339341
async def get_billing(

0 commit comments

Comments
 (0)