-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.5.4" | ||
__version__ = "0.5.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters