Skip to content

Commit

Permalink
v0.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
denisneuf committed Jan 31, 2024
1 parent 9aae129 commit c530677
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ad_api/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .validation_configurations import ValidationConfigurations
from .recommendations import Recommendations
from .stream import Stream
from .exports import Exports

__all__ = [
"sp",
Expand Down Expand Up @@ -47,4 +48,5 @@
"ValidationConfigurations",
"Recommendations",
"Stream",
"Exports",
]
46 changes: 46 additions & 0 deletions ad_api/api/exports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils


class Exports(Client):
"""Amazon Ads API Exports Version 3
"""
@sp_endpoint('/campaigns/export', method='POST')
def campaigns_export(self, version: int = 1, **kwargs) -> ApiResponse:
r"""
application/vnd.campaignsexport.v1+json
"""
content_type = 'application/vnd.campaignsexport.v'+ str(version) +'+json'
accept = 'application/vnd.campaignsexport.v'+ str(version) +'+json'
headers = {'Content-Type': content_type, 'Accept': accept}
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)


@sp_endpoint('/adGroups/export', method='POST')
def adgroups_export(self, version: int = 1, **kwargs) -> ApiResponse:
r"""
application/vnd.adgroupsexport.v1+json
"""
content_type = 'application/vnd.adgroupsexport.v'+ str(version) +'+json'
accept = 'application/vnd.adgroupsexport.v'+ str(version) +'+json'
headers = {'Content-Type': content_type, 'Accept': accept}
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)


@sp_endpoint('/targets/export', method='POST')
def targets_export(self, version: int = 1, **kwargs) -> ApiResponse:
r"""
application/vnd.targetsexport.v1+json
"""
content_type = 'application/vnd.targetsexport.v'+ str(version) +'+json'
accept = 'application/vnd.targetsexport.v'+ str(version) +'+json'
headers = {'Content-Type': content_type, 'Accept': accept}
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)


@sp_endpoint('/exports/{}', method='GET')
def get_export(self, exportId, typeExport, version: int = 1, **kwargs) -> ApiResponse:
r"""
"""
content_type = 'application/vnd.'+typeExport+'export.v' + str(version) + '+json'
headers = {'Content-Type': content_type, 'Accept': content_type}
return self._request(fill_query_params(kwargs.pop('path'), exportId), params=kwargs, headers=headers)
2 changes: 1 addition & 1 deletion ad_api/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.4"
__version__ = "0.5.5"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = python-amazon-ad-api
version = 0.5.4
version = 0.5.5
author = Daniel Alvaro
author_email = [email protected]
description = Python wrapper for the Amazon Advertising API
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='python-amazon-ad-api',
version='0.5.4',
version='0.5.5',
install_requires=[
"requests>=2.27.1,<2.32.0",
"six~=1.16.0",
Expand Down

0 comments on commit c530677

Please sign in to comment.