python-amazon-ad-api 2.4.2__py3-none-any.whl → 2.4.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ad_api/api/__init__.py +6 -0
- ad_api/api/amc/__init__.py +4 -0
- ad_api/api/amc/administration.py +47 -0
- ad_api/api/amc/custom_models.py +924 -0
- ad_api/version.py +1 -1
- {python_amazon_ad_api-2.4.2.dist-info → python_amazon_ad_api-2.4.3.dist-info}/METADATA +1 -1
- {python_amazon_ad_api-2.4.2.dist-info → python_amazon_ad_api-2.4.3.dist-info}/RECORD +10 -7
- {python_amazon_ad_api-2.4.2.dist-info → python_amazon_ad_api-2.4.3.dist-info}/WHEEL +0 -0
- {python_amazon_ad_api-2.4.2.dist-info → python_amazon_ad_api-2.4.3.dist-info}/licenses/LICENSE +0 -0
- {python_amazon_ad_api-2.4.2.dist-info → python_amazon_ad_api-2.4.3.dist-info}/top_level.txt +0 -0
ad_api/api/__init__.py
CHANGED
|
@@ -17,6 +17,8 @@ from . import sp as sponsored_products
|
|
|
17
17
|
from . import sb as sponsored_brands
|
|
18
18
|
from . import sd as sponsored_display
|
|
19
19
|
from . import st as sponsored_tv
|
|
20
|
+
from . import amc as amazon_marketing_cloud
|
|
21
|
+
from .amc.custom_models import CustomModels
|
|
20
22
|
from .attribution import Attribution
|
|
21
23
|
from .brand_metrics import BrandMetrics
|
|
22
24
|
from .brand_benchmarks import BrandBenchmarks
|
|
@@ -92,6 +94,8 @@ __all__ = [
|
|
|
92
94
|
"sponsored_products",
|
|
93
95
|
"sponsored_brands",
|
|
94
96
|
"sponsored_display",
|
|
97
|
+
"amc",
|
|
98
|
+
"amazon_marketing_cloud",
|
|
95
99
|
"Profiles",
|
|
96
100
|
"ManagerAccounts",
|
|
97
101
|
"Billing",
|
|
@@ -126,6 +130,8 @@ __all__ = [
|
|
|
126
130
|
"PartnerOpportunities",
|
|
127
131
|
"PersonaBuilder",
|
|
128
132
|
"CampaignDiagnostics",
|
|
133
|
+
"CustomModels",
|
|
134
|
+
"Administration",
|
|
129
135
|
"PreModeration",
|
|
130
136
|
"Moderation",
|
|
131
137
|
"AdLibrary",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Administration(Client):
|
|
5
|
+
r"""
|
|
6
|
+
Administration(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
|
|
7
|
+
|
|
8
|
+
Amazon Marketing Cloud - Administration
|
|
9
|
+
|
|
10
|
+
Endpoints under ``/amc/...`` for managing AMC accounts and instances.
|
|
11
|
+
|
|
12
|
+
All endpoints require the ``Amazon-Advertising-API-ClientId`` header
|
|
13
|
+
(sent automatically from ``client_id`` in credentials).
|
|
14
|
+
|
|
15
|
+
No identity headers (Scope/AccountId/ManagerAccount) are required.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
@sp_endpoint('/amc/accounts', method='GET', headers=[])
|
|
19
|
+
def list_accounts(self, version: str = "1", **kwargs) -> ApiResponse:
|
|
20
|
+
r"""
|
|
21
|
+
list_accounts(next_token: str = None) -> ApiResponse
|
|
22
|
+
|
|
23
|
+
Get a list of AMC Accounts (operationId: AmcpLinkListAmcAccounts)
|
|
24
|
+
|
|
25
|
+
Query Parameters
|
|
26
|
+
| **nextToken** (string) [optional] Token to retrieve subsequent page of results
|
|
27
|
+
|
|
28
|
+
Headers
|
|
29
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
30
|
+
|
|
31
|
+
Returns
|
|
32
|
+
ApiResponse
|
|
33
|
+
| **amcAccounts** (array)
|
|
34
|
+
| **amcAccountId** (string)
|
|
35
|
+
| **amcInstanceId** (string)
|
|
36
|
+
| **instanceName** (string)
|
|
37
|
+
| **region** (string)
|
|
38
|
+
| **status** (string)
|
|
39
|
+
| **createdTime** (string)
|
|
40
|
+
| **updatedTime** (string)
|
|
41
|
+
| **nextToken** (string)
|
|
42
|
+
|
|
43
|
+
"""
|
|
44
|
+
schema_version = f'application/vnd.amcaudiencesconnections.v{version}+json'
|
|
45
|
+
headers = {'Accept': schema_version}
|
|
46
|
+
params = dict(kwargs)
|
|
47
|
+
return self._request(kwargs.pop('path'), params=kwargs, headers=headers)
|
|
@@ -0,0 +1,924 @@
|
|
|
1
|
+
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class CustomModels(Client):
|
|
5
|
+
r"""
|
|
6
|
+
CustomModels(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
|
|
7
|
+
|
|
8
|
+
Amazon Marketing Cloud - Custom Models (Rule-based Audiences)
|
|
9
|
+
|
|
10
|
+
Endpoints under ``/amc/models/v1/...`` for managing trained models, input channels,
|
|
11
|
+
modeled datasets, data exports, and inference jobs.
|
|
12
|
+
|
|
13
|
+
All endpoints require the ``Amazon-Marketing-Cloud-InstanceId`` query parameter
|
|
14
|
+
and the ``Amazon-Advertising-API-ClientId`` header (sent automatically from
|
|
15
|
+
``client_id`` in credentials).
|
|
16
|
+
|
|
17
|
+
The request/response media type is ``application/vnd.amcmodelbasedaudience.v1+json``.
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@sp_endpoint('/amc/models/v1/mlDataExports', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
23
|
+
def create_ml_data_export(self, body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
24
|
+
r"""
|
|
25
|
+
create_ml_data_export(body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
26
|
+
|
|
27
|
+
Creates workflow to export ML data for model-based audiences (operationId: CreateMlDataExport)
|
|
28
|
+
|
|
29
|
+
Query Parameters
|
|
30
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
31
|
+
|
|
32
|
+
Request Body (application/vnd.amcmodelbasedaudience.v{version}+json)
|
|
33
|
+
| **dataType** (string) [required]
|
|
34
|
+
| **inferenceJobId** (string) [required]
|
|
35
|
+
| **trainedModelId** (string) [required]
|
|
36
|
+
|
|
37
|
+
Headers
|
|
38
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
39
|
+
| **Amazon-Advertising-API-Scope** (string) [optional] From profile_id
|
|
40
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
41
|
+
|
|
42
|
+
Returns
|
|
43
|
+
ApiResponse
|
|
44
|
+
| **mlDataExportId** (string)
|
|
45
|
+
|
|
46
|
+
"""
|
|
47
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
48
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
49
|
+
path = kwargs.pop('path')
|
|
50
|
+
params = dict(kwargs)
|
|
51
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
52
|
+
if selector:
|
|
53
|
+
params['selector'] = selector
|
|
54
|
+
return self._request(
|
|
55
|
+
path,
|
|
56
|
+
data=Utils.convert_body(body, False),
|
|
57
|
+
params=params,
|
|
58
|
+
headers=headers
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
@sp_endpoint('/amc/models/v1/mlDataExports/list', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
62
|
+
def list_ml_data_exports(self, amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None, **kwargs) -> ApiResponse:
|
|
63
|
+
r"""
|
|
64
|
+
list_ml_data_exports(amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None) -> ApiResponse
|
|
65
|
+
|
|
66
|
+
List MlDataExport metadata (operationId: ListMlDataExports)
|
|
67
|
+
|
|
68
|
+
Query Parameters
|
|
69
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
70
|
+
| **maxResults** (integer) [optional] Min 1, max 100. Default 100
|
|
71
|
+
| **nextToken** (string) [optional] Token to retrieve subsequent page
|
|
72
|
+
|
|
73
|
+
Headers
|
|
74
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
75
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
76
|
+
|
|
77
|
+
Returns
|
|
78
|
+
ApiResponse
|
|
79
|
+
| **mlDataExports** (array) List of export metadata
|
|
80
|
+
|
|
81
|
+
"""
|
|
82
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
83
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
84
|
+
path = kwargs.pop('path')
|
|
85
|
+
params = dict(kwargs)
|
|
86
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
87
|
+
params['maxResults'] = max_results
|
|
88
|
+
if next_token:
|
|
89
|
+
params['nextToken'] = next_token
|
|
90
|
+
if selector:
|
|
91
|
+
params['selector'] = selector
|
|
92
|
+
return self._request(
|
|
93
|
+
path,
|
|
94
|
+
data=None,
|
|
95
|
+
params=params,
|
|
96
|
+
headers=headers
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
@sp_endpoint('/amc/models/v1/mlDataExports/{}', method='GET', headers=['Amazon-Ads-AccountId'])
|
|
100
|
+
def get_ml_data_export(self, ml_data_export_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
101
|
+
r"""
|
|
102
|
+
get_ml_data_export(ml_data_export_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
103
|
+
|
|
104
|
+
Get MlDataExport metadata for a given mlDataExportId (operationId: GetMlDataExport)
|
|
105
|
+
|
|
106
|
+
Path Parameters
|
|
107
|
+
| **mlDataExportId** (string) [required] ML data export identifier
|
|
108
|
+
|
|
109
|
+
Query Parameters
|
|
110
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
111
|
+
|
|
112
|
+
Headers
|
|
113
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
114
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
115
|
+
|
|
116
|
+
Returns
|
|
117
|
+
ApiResponse
|
|
118
|
+
| **mlDataExport** (object) ML data export metadata
|
|
119
|
+
|
|
120
|
+
"""
|
|
121
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
122
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
123
|
+
path = fill_query_params(kwargs.pop('path'), ml_data_export_id)
|
|
124
|
+
params = dict(kwargs)
|
|
125
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
126
|
+
if selector:
|
|
127
|
+
params['selector'] = selector
|
|
128
|
+
return self._request(
|
|
129
|
+
path,
|
|
130
|
+
data=None,
|
|
131
|
+
params=params,
|
|
132
|
+
headers=headers
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
@sp_endpoint('/amc/models/v1/mlInputChannels', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
136
|
+
def create_ml_input_channel(self, body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
137
|
+
r"""
|
|
138
|
+
create_ml_input_channel(body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
139
|
+
|
|
140
|
+
Create an ML input channel (operationId: CreateMlInputChannel)
|
|
141
|
+
|
|
142
|
+
Query Parameters
|
|
143
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
144
|
+
|
|
145
|
+
Request Body (application/vnd.amcmodelbasedaudience.v{version}+json)
|
|
146
|
+
| **configuredModelAlgorithmAssociations** (array[string]) [required] ARN(s) of configured model algorithm association(s)
|
|
147
|
+
| **name** (string) [required] Name of the ML input channel
|
|
148
|
+
| **queryParameters** (object) [required] AMC query definition
|
|
149
|
+
| **amcQuery** (string) [required] Customer created query
|
|
150
|
+
| **timeWindowStart** (string) [required] UTC date-time yyyy-MM-dd'T'HH:mm:ss'Z'
|
|
151
|
+
| **timeWindowEnd** (string) [required] UTC date-time yyyy-MM-dd'T'HH:mm:ss'Z'
|
|
152
|
+
| **inputParameters** (object) [optional]
|
|
153
|
+
| **parameterValues** (object) [optional]
|
|
154
|
+
| **enforceAggregationThresholds** (boolean) [optional] Default false
|
|
155
|
+
| **enforceUserLevelTargeting** (boolean) [optional]
|
|
156
|
+
| **idempotencyKey** (string) [optional] Prevent duplicate records
|
|
157
|
+
| **outputFormat** (string) [optional] CSV or PARQUET, defaults to CSV
|
|
158
|
+
|
|
159
|
+
Headers
|
|
160
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
161
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
162
|
+
|
|
163
|
+
Returns
|
|
164
|
+
ApiResponse
|
|
165
|
+
| **mlInputChannelId** (string)
|
|
166
|
+
|
|
167
|
+
"""
|
|
168
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
169
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
170
|
+
path = kwargs.pop('path')
|
|
171
|
+
params = dict(kwargs)
|
|
172
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
173
|
+
if selector:
|
|
174
|
+
params['selector'] = selector
|
|
175
|
+
return self._request(
|
|
176
|
+
path,
|
|
177
|
+
data=Utils.convert_body(body, False),
|
|
178
|
+
params=params,
|
|
179
|
+
headers=headers
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
@sp_endpoint('/amc/models/v1/mlInputChannels/list', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
183
|
+
def list_ml_input_channels(self, amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None, **kwargs) -> ApiResponse:
|
|
184
|
+
r"""
|
|
185
|
+
list_ml_input_channels(amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None) -> ApiResponse
|
|
186
|
+
|
|
187
|
+
List ML input channels (operationId: ListMlInputChannelByInstanceId)
|
|
188
|
+
|
|
189
|
+
Query Parameters
|
|
190
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
191
|
+
| **maxResults** (integer) [optional] Min 1, max 100. Default 100
|
|
192
|
+
| **nextToken** (string) [optional] Token to retrieve subsequent page
|
|
193
|
+
|
|
194
|
+
Headers
|
|
195
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
196
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
197
|
+
|
|
198
|
+
Returns
|
|
199
|
+
ApiResponse
|
|
200
|
+
| **mlInputChannels** (array) List of input channel metadata
|
|
201
|
+
|
|
202
|
+
"""
|
|
203
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
204
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
205
|
+
path = kwargs.pop('path')
|
|
206
|
+
params = dict(kwargs)
|
|
207
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
208
|
+
params['maxResults'] = max_results
|
|
209
|
+
if next_token:
|
|
210
|
+
params['nextToken'] = next_token
|
|
211
|
+
if selector:
|
|
212
|
+
params['selector'] = selector
|
|
213
|
+
return self._request(
|
|
214
|
+
path,
|
|
215
|
+
data=None,
|
|
216
|
+
params=params,
|
|
217
|
+
headers=headers
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
@sp_endpoint('/amc/models/v1/mlInputChannels/{}', method='GET', headers=['Amazon-Ads-AccountId'])
|
|
221
|
+
def get_ml_input_channel(self, ml_input_channel_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
222
|
+
r"""
|
|
223
|
+
get_ml_input_channel(ml_input_channel_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
224
|
+
|
|
225
|
+
Get ML input channel metadata (operationId: GetMlInputChannel)
|
|
226
|
+
|
|
227
|
+
Path Parameters
|
|
228
|
+
| **mlInputChannelId** (string) [required] ML input channel identifier
|
|
229
|
+
|
|
230
|
+
Query Parameters
|
|
231
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
232
|
+
|
|
233
|
+
Headers
|
|
234
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
235
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
236
|
+
|
|
237
|
+
Returns
|
|
238
|
+
ApiResponse
|
|
239
|
+
| **mlInputChannel** (object) ML input channel metadata
|
|
240
|
+
|
|
241
|
+
"""
|
|
242
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
243
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
244
|
+
path = fill_query_params(kwargs.pop('path'), ml_input_channel_id)
|
|
245
|
+
params = dict(kwargs)
|
|
246
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
247
|
+
if selector:
|
|
248
|
+
params['selector'] = selector
|
|
249
|
+
return self._request(
|
|
250
|
+
path,
|
|
251
|
+
data=None,
|
|
252
|
+
params=params,
|
|
253
|
+
headers=headers
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
@sp_endpoint('/amc/models/v1/mlInputChannels/{}', method='DELETE', headers=['Amazon-Ads-AccountId'])
|
|
257
|
+
def delete_ml_input_channel(self, ml_input_channel_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
258
|
+
r"""
|
|
259
|
+
delete_ml_input_channel(ml_input_channel_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
260
|
+
|
|
261
|
+
Delete an ML input channel (operationId: DeleteMlInputChannel)
|
|
262
|
+
|
|
263
|
+
Path Parameters
|
|
264
|
+
| **mlInputChannelId** (string) [required] ML input channel identifier
|
|
265
|
+
|
|
266
|
+
Query Parameters
|
|
267
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
268
|
+
|
|
269
|
+
Headers
|
|
270
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
271
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
272
|
+
|
|
273
|
+
Returns
|
|
274
|
+
ApiResponse
|
|
275
|
+
(204 No Content on success)
|
|
276
|
+
|
|
277
|
+
"""
|
|
278
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
279
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
280
|
+
path = fill_query_params(kwargs.pop('path'), ml_input_channel_id)
|
|
281
|
+
params = dict(kwargs)
|
|
282
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
283
|
+
if selector:
|
|
284
|
+
params['selector'] = selector
|
|
285
|
+
return self._request(
|
|
286
|
+
path,
|
|
287
|
+
data=None,
|
|
288
|
+
params=params,
|
|
289
|
+
headers=headers
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
@sp_endpoint('/amc/models/v1/modeledDatasets', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
293
|
+
def create_modeled_dataset(self, body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
294
|
+
r"""
|
|
295
|
+
create_modeled_dataset(body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
296
|
+
|
|
297
|
+
Create a modeled dataset (operationId: CreateModeledDataset)
|
|
298
|
+
|
|
299
|
+
Query Parameters
|
|
300
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
301
|
+
|
|
302
|
+
Request Body (application/vnd.amcmodelbasedaudience.v{version}+json)
|
|
303
|
+
| **name** (string) [required] Name of the modeled dataset
|
|
304
|
+
| **schema** (object) [required] Dataset schema
|
|
305
|
+
| **tableColumns** (array) [required] List of columns (1-50)
|
|
306
|
+
| **columnName** (string) [required] Column name
|
|
307
|
+
| **dataType** (string) [required] Data type
|
|
308
|
+
| **userIdColumn** (boolean) [required] True for the ad user id column (must be STRING)
|
|
309
|
+
| **description** (string) [optional]
|
|
310
|
+
| **description** (string) [optional] Description of the modeled dataset
|
|
311
|
+
|
|
312
|
+
Headers
|
|
313
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
314
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
315
|
+
|
|
316
|
+
Returns
|
|
317
|
+
ApiResponse
|
|
318
|
+
| **modeledDatasetId** (string)
|
|
319
|
+
|
|
320
|
+
"""
|
|
321
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
322
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
323
|
+
path = kwargs.pop('path')
|
|
324
|
+
params = dict(kwargs)
|
|
325
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
326
|
+
if selector:
|
|
327
|
+
params['selector'] = selector
|
|
328
|
+
return self._request(
|
|
329
|
+
path,
|
|
330
|
+
data=Utils.convert_body(body, False),
|
|
331
|
+
params=params,
|
|
332
|
+
headers=headers
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
@sp_endpoint('/amc/models/v1/modeledDatasets/list', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
336
|
+
def list_modeled_datasets(self, amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None, **kwargs) -> ApiResponse:
|
|
337
|
+
r"""
|
|
338
|
+
list_modeled_datasets(amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None) -> ApiResponse
|
|
339
|
+
|
|
340
|
+
List modeled datasets (operationId: ListModeledDatasetByInstanceId)
|
|
341
|
+
|
|
342
|
+
Query Parameters
|
|
343
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
344
|
+
| **maxResults** (integer) [optional] Min 1, max 100. Default 100
|
|
345
|
+
| **nextToken** (string) [optional] Token to retrieve subsequent page
|
|
346
|
+
|
|
347
|
+
Headers
|
|
348
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
349
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
350
|
+
|
|
351
|
+
Returns
|
|
352
|
+
ApiResponse
|
|
353
|
+
| **modeledDatasets** (array) List of modeled dataset metadata
|
|
354
|
+
|
|
355
|
+
"""
|
|
356
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
357
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
358
|
+
path = kwargs.pop('path')
|
|
359
|
+
params = dict(kwargs)
|
|
360
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
361
|
+
params['maxResults'] = max_results
|
|
362
|
+
if next_token:
|
|
363
|
+
params['nextToken'] = next_token
|
|
364
|
+
if selector:
|
|
365
|
+
params['selector'] = selector
|
|
366
|
+
return self._request(
|
|
367
|
+
path,
|
|
368
|
+
data=None,
|
|
369
|
+
params=params,
|
|
370
|
+
headers=headers
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
@sp_endpoint('/amc/models/v1/modeledDatasets/{}', method='GET', headers=['Amazon-Ads-AccountId'])
|
|
374
|
+
def get_modeled_dataset(self, modeled_dataset_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
375
|
+
r"""
|
|
376
|
+
get_modeled_dataset(modeled_dataset_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
377
|
+
|
|
378
|
+
Get modeled dataset metadata (operationId: GetModeledDataset)
|
|
379
|
+
|
|
380
|
+
Path Parameters
|
|
381
|
+
| **modeledDatasetId** (string) [required] Modeled dataset identifier
|
|
382
|
+
|
|
383
|
+
Query Parameters
|
|
384
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
385
|
+
|
|
386
|
+
Headers
|
|
387
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
388
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
389
|
+
|
|
390
|
+
Returns
|
|
391
|
+
ApiResponse
|
|
392
|
+
| **modeledDataset** (object) Modeled dataset metadata
|
|
393
|
+
|
|
394
|
+
"""
|
|
395
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
396
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
397
|
+
path = fill_query_params(kwargs.pop('path'), modeled_dataset_id)
|
|
398
|
+
params = dict(kwargs)
|
|
399
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
400
|
+
if selector:
|
|
401
|
+
params['selector'] = selector
|
|
402
|
+
return self._request(
|
|
403
|
+
path,
|
|
404
|
+
data=None,
|
|
405
|
+
params=params,
|
|
406
|
+
headers=headers
|
|
407
|
+
)
|
|
408
|
+
|
|
409
|
+
@sp_endpoint('/amc/models/v1/modeledDatasets/{}', method='DELETE', headers=['Amazon-Ads-AccountId'])
|
|
410
|
+
def delete_modeled_dataset(self, modeled_dataset_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
411
|
+
r"""
|
|
412
|
+
delete_modeled_dataset(modeled_dataset_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
413
|
+
|
|
414
|
+
Delete a modeled dataset (operationId: DeleteModeledDataset)
|
|
415
|
+
|
|
416
|
+
Path Parameters
|
|
417
|
+
| **modeledDatasetId** (string) [required] Modeled dataset identifier
|
|
418
|
+
|
|
419
|
+
Query Parameters
|
|
420
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
421
|
+
|
|
422
|
+
Headers
|
|
423
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
424
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
425
|
+
|
|
426
|
+
Returns
|
|
427
|
+
ApiResponse
|
|
428
|
+
(204 No Content on success)
|
|
429
|
+
|
|
430
|
+
"""
|
|
431
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
432
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
433
|
+
path = fill_query_params(kwargs.pop('path'), modeled_dataset_id)
|
|
434
|
+
params = dict(kwargs)
|
|
435
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
436
|
+
if selector:
|
|
437
|
+
params['selector'] = selector
|
|
438
|
+
return self._request(
|
|
439
|
+
path,
|
|
440
|
+
data=None,
|
|
441
|
+
params=params,
|
|
442
|
+
headers=headers
|
|
443
|
+
)
|
|
444
|
+
|
|
445
|
+
@sp_endpoint('/amc/models/v1/modeledDatasetUploadJobs', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
446
|
+
def create_modeled_dataset_upload_job(self, body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
447
|
+
r"""
|
|
448
|
+
create_modeled_dataset_upload_job(body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
449
|
+
|
|
450
|
+
Create a modeled dataset upload job (operationId: CreateModeledDatasetUploadJob)
|
|
451
|
+
|
|
452
|
+
Query Parameters
|
|
453
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
454
|
+
|
|
455
|
+
Request Body (application/vnd.amcmodelbasedaudience.v{version}+json)
|
|
456
|
+
| **modeledDatasetId** (string) [required] Modeled dataset identifier
|
|
457
|
+
| **trainedModelIds** (array[string]) [optional] Trained model IDs (max 1)
|
|
458
|
+
| **inferenceJobIds** (array[string]) [optional] Inference job IDs (max 1)
|
|
459
|
+
| **updateStrategy** (string) [optional] ADDITIVE or FULL_REPLACE
|
|
460
|
+
|
|
461
|
+
Headers
|
|
462
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
463
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
464
|
+
|
|
465
|
+
Returns
|
|
466
|
+
ApiResponse
|
|
467
|
+
| **modeledDatasetUploadJobId** (string)
|
|
468
|
+
|
|
469
|
+
"""
|
|
470
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
471
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
472
|
+
path = kwargs.pop('path')
|
|
473
|
+
params = dict(kwargs)
|
|
474
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
475
|
+
if selector:
|
|
476
|
+
params['selector'] = selector
|
|
477
|
+
return self._request(
|
|
478
|
+
path,
|
|
479
|
+
data=Utils.convert_body(body, False),
|
|
480
|
+
params=params,
|
|
481
|
+
headers=headers
|
|
482
|
+
)
|
|
483
|
+
|
|
484
|
+
@sp_endpoint('/amc/models/v1/modeledDatasetUploadJobs/list', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
485
|
+
def list_modeled_dataset_upload_jobs(self, amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None, **kwargs) -> ApiResponse:
|
|
486
|
+
r"""
|
|
487
|
+
list_modeled_dataset_upload_jobs(amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None) -> ApiResponse
|
|
488
|
+
|
|
489
|
+
List modeled dataset upload jobs (operationId: ListModeledDatasetUploadJobByInstanceId)
|
|
490
|
+
|
|
491
|
+
Query Parameters
|
|
492
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
493
|
+
| **maxResults** (integer) [optional] Min 1, max 100. Default 100
|
|
494
|
+
| **nextToken** (string) [optional] Token to retrieve subsequent page
|
|
495
|
+
|
|
496
|
+
Headers
|
|
497
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
498
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
499
|
+
|
|
500
|
+
Returns
|
|
501
|
+
ApiResponse
|
|
502
|
+
| **modeledDatasetUploadJobs** (array) List of upload job metadata
|
|
503
|
+
|
|
504
|
+
"""
|
|
505
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
506
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
507
|
+
path = kwargs.pop('path')
|
|
508
|
+
params = dict(kwargs)
|
|
509
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
510
|
+
params['maxResults'] = max_results
|
|
511
|
+
if next_token:
|
|
512
|
+
params['nextToken'] = next_token
|
|
513
|
+
if selector:
|
|
514
|
+
params['selector'] = selector
|
|
515
|
+
return self._request(
|
|
516
|
+
path,
|
|
517
|
+
data=None,
|
|
518
|
+
params=params,
|
|
519
|
+
headers=headers
|
|
520
|
+
)
|
|
521
|
+
|
|
522
|
+
@sp_endpoint('/amc/models/v1/modeledDatasetUploadJobs/{}', method='GET', headers=['Amazon-Ads-AccountId'])
|
|
523
|
+
def get_modeled_dataset_upload_job(self, modeled_dataset_upload_job_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
524
|
+
r"""
|
|
525
|
+
get_modeled_dataset_upload_job(modeled_dataset_upload_job_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
526
|
+
|
|
527
|
+
Get modeled dataset upload job metadata (operationId: GetModeledDatasetUploadJob)
|
|
528
|
+
|
|
529
|
+
Path Parameters
|
|
530
|
+
| **modeledDatasetUploadJobId** (string) [required] Upload job identifier
|
|
531
|
+
|
|
532
|
+
Query Parameters
|
|
533
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
534
|
+
|
|
535
|
+
Headers
|
|
536
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
537
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
538
|
+
|
|
539
|
+
Returns
|
|
540
|
+
ApiResponse
|
|
541
|
+
| **modeledDatasetUploadJob** (object) Upload job metadata
|
|
542
|
+
|
|
543
|
+
"""
|
|
544
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
545
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
546
|
+
path = fill_query_params(kwargs.pop('path'), modeled_dataset_upload_job_id)
|
|
547
|
+
params = dict(kwargs)
|
|
548
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
549
|
+
if selector:
|
|
550
|
+
params['selector'] = selector
|
|
551
|
+
return self._request(
|
|
552
|
+
path,
|
|
553
|
+
data=None,
|
|
554
|
+
params=params,
|
|
555
|
+
headers=headers
|
|
556
|
+
)
|
|
557
|
+
|
|
558
|
+
@sp_endpoint('/amc/models/v1/trainedModels', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
559
|
+
def create_trained_model(self, body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
560
|
+
r"""
|
|
561
|
+
create_trained_model(body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
562
|
+
|
|
563
|
+
Create a trained model (operationId: CreateTrainedModel)
|
|
564
|
+
|
|
565
|
+
Query Parameters
|
|
566
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
567
|
+
|
|
568
|
+
Request Body (application/vnd.amcmodelbasedaudience.v{version}+json)
|
|
569
|
+
| **configuredModelAlgorithmAssociationArn** (string) [required] ARN of configured model algorithm association
|
|
570
|
+
| **name** (string) [required] Customer provided name for trained model
|
|
571
|
+
| **queryParameters** (object) [required] AMC query definition
|
|
572
|
+
| **amcQuery** (string) [required] Customer created query
|
|
573
|
+
| **timeWindowStart** (string) [required] UTC date-time yyyy-MM-dd'T'HH:mm:ss'Z'
|
|
574
|
+
| **timeWindowEnd** (string) [required] UTC date-time yyyy-MM-dd'T'HH:mm:ss'Z'
|
|
575
|
+
| **inputParameters** (array) [optional] Query input parameters
|
|
576
|
+
| **parameterValues** (object) [optional] Custom parameters
|
|
577
|
+
| **mlInputChannels** (array) [required] List of input channels (1-20)
|
|
578
|
+
| **channelName** (string) [required] Channel name
|
|
579
|
+
| **mlInputChannelId** (string) [required] ML input channel ID
|
|
580
|
+
| **description** (string) [optional] Customer provided description
|
|
581
|
+
| **enforceAnonymizedResults** (boolean) [optional] Default false
|
|
582
|
+
| **enforceUserLevelTargeting** (boolean) [optional]
|
|
583
|
+
| **environment** (object) [optional] Environment variables for Docker container
|
|
584
|
+
| **featureFields** (object) [optional] Features for importance computation
|
|
585
|
+
| **hyperParameters** (object) [optional] Algorithm-specific parameters
|
|
586
|
+
| **idempotencyKey** (string) [optional] Prevent duplicate records
|
|
587
|
+
| **incrementalTrainingDataChannels** (array) [optional] Incremental training models (max 1)
|
|
588
|
+
| **channelName** (string) [required]
|
|
589
|
+
| **trainedModelId** (string) [required]
|
|
590
|
+
| **resourceConfig** (object) [optional] Training resource configuration
|
|
591
|
+
| **instanceCount** (integer) [optional] Default 1, max 10
|
|
592
|
+
| **instanceType** (string) [optional]
|
|
593
|
+
| **volumeSizeInGb** (integer) [optional] Max 8192
|
|
594
|
+
| **stoppingCondition** (object) [optional] Training time limit
|
|
595
|
+
| **maxRuntimeInSeconds** (integer) [optional] Default 86400, max 2419200
|
|
596
|
+
|
|
597
|
+
Headers
|
|
598
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
599
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
600
|
+
|
|
601
|
+
Returns
|
|
602
|
+
ApiResponse
|
|
603
|
+
| **trainedModelId** (string)
|
|
604
|
+
|
|
605
|
+
"""
|
|
606
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
607
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
608
|
+
path = kwargs.pop('path')
|
|
609
|
+
params = dict(kwargs)
|
|
610
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
611
|
+
if selector:
|
|
612
|
+
params['selector'] = selector
|
|
613
|
+
return self._request(
|
|
614
|
+
path,
|
|
615
|
+
data=Utils.convert_body(body, False),
|
|
616
|
+
params=params,
|
|
617
|
+
headers=headers
|
|
618
|
+
)
|
|
619
|
+
|
|
620
|
+
@sp_endpoint('/amc/models/v1/trainedModels/list', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
621
|
+
def list_trained_models(self, amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None, **kwargs) -> ApiResponse:
|
|
622
|
+
r"""
|
|
623
|
+
list_trained_models(amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None) -> ApiResponse
|
|
624
|
+
|
|
625
|
+
List trained models (operationId: ListTrainedModelByInstanceId)
|
|
626
|
+
|
|
627
|
+
Query Parameters
|
|
628
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
629
|
+
| **maxResults** (integer) [optional] Min 1, max 100. Default 100
|
|
630
|
+
| **nextToken** (string) [optional] Token to retrieve subsequent page
|
|
631
|
+
|
|
632
|
+
Headers
|
|
633
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
634
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
635
|
+
|
|
636
|
+
Returns
|
|
637
|
+
ApiResponse
|
|
638
|
+
| **trainedModels** (array) List of trained model metadata
|
|
639
|
+
|
|
640
|
+
"""
|
|
641
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
642
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
643
|
+
path = kwargs.pop('path')
|
|
644
|
+
params = dict(kwargs)
|
|
645
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
646
|
+
params['maxResults'] = max_results
|
|
647
|
+
if next_token:
|
|
648
|
+
params['nextToken'] = next_token
|
|
649
|
+
if selector:
|
|
650
|
+
params['selector'] = selector
|
|
651
|
+
return self._request(
|
|
652
|
+
path,
|
|
653
|
+
data=None,
|
|
654
|
+
params=params,
|
|
655
|
+
headers=headers
|
|
656
|
+
)
|
|
657
|
+
|
|
658
|
+
@sp_endpoint('/amc/models/v1/trainedModels/{}', method='GET', headers=['Amazon-Ads-AccountId'])
|
|
659
|
+
def get_trained_model(self, trained_model_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
660
|
+
r"""
|
|
661
|
+
get_trained_model(trained_model_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
662
|
+
|
|
663
|
+
Get trained model metadata (operationId: GetTrainedModel)
|
|
664
|
+
|
|
665
|
+
Path Parameters
|
|
666
|
+
| **trainedModelId** (string) [required] Trained model identifier
|
|
667
|
+
|
|
668
|
+
Query Parameters
|
|
669
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
670
|
+
|
|
671
|
+
Headers
|
|
672
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
673
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
674
|
+
|
|
675
|
+
Returns
|
|
676
|
+
ApiResponse
|
|
677
|
+
| **trainedModel** (object) Trained model metadata
|
|
678
|
+
|
|
679
|
+
"""
|
|
680
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
681
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
682
|
+
path = fill_query_params(kwargs.pop('path'), trained_model_id)
|
|
683
|
+
params = dict(kwargs)
|
|
684
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
685
|
+
if selector:
|
|
686
|
+
params['selector'] = selector
|
|
687
|
+
return self._request(
|
|
688
|
+
path,
|
|
689
|
+
data=None,
|
|
690
|
+
params=params,
|
|
691
|
+
headers=headers
|
|
692
|
+
)
|
|
693
|
+
|
|
694
|
+
@sp_endpoint('/amc/models/v1/trainedModels/{}', method='DELETE', headers=['Amazon-Ads-AccountId'])
|
|
695
|
+
def delete_trained_model(self, trained_model_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
696
|
+
r"""
|
|
697
|
+
delete_trained_model(trained_model_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
698
|
+
|
|
699
|
+
Delete a trained model (operationId: DeleteTrainedModel)
|
|
700
|
+
|
|
701
|
+
Path Parameters
|
|
702
|
+
| **trainedModelId** (string) [required] Trained model identifier
|
|
703
|
+
|
|
704
|
+
Query Parameters
|
|
705
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
706
|
+
|
|
707
|
+
Headers
|
|
708
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
709
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
710
|
+
|
|
711
|
+
Returns
|
|
712
|
+
ApiResponse
|
|
713
|
+
(204 No Content on success)
|
|
714
|
+
|
|
715
|
+
"""
|
|
716
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
717
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
718
|
+
path = fill_query_params(kwargs.pop('path'), trained_model_id)
|
|
719
|
+
params = dict(kwargs)
|
|
720
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
721
|
+
if selector:
|
|
722
|
+
params['selector'] = selector
|
|
723
|
+
return self._request(
|
|
724
|
+
path,
|
|
725
|
+
data=None,
|
|
726
|
+
params=params,
|
|
727
|
+
headers=headers
|
|
728
|
+
)
|
|
729
|
+
|
|
730
|
+
@sp_endpoint('/amc/models/v1/trainedModels/{}/cancel', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
731
|
+
def cancel_trained_model(self, trained_model_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
732
|
+
r"""
|
|
733
|
+
cancel_trained_model(trained_model_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
734
|
+
|
|
735
|
+
Cancel a trained model training job (operationId: CancelTrainedModel)
|
|
736
|
+
|
|
737
|
+
Path Parameters
|
|
738
|
+
| **trainedModelId** (string) [required] Trained model identifier
|
|
739
|
+
|
|
740
|
+
Query Parameters
|
|
741
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
742
|
+
|
|
743
|
+
Headers
|
|
744
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
745
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
746
|
+
|
|
747
|
+
Returns
|
|
748
|
+
ApiResponse
|
|
749
|
+
| **trainedModelId** (string)
|
|
750
|
+
|
|
751
|
+
"""
|
|
752
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
753
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
754
|
+
path = fill_query_params(kwargs.pop('path'), trained_model_id)
|
|
755
|
+
params = dict(kwargs)
|
|
756
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
757
|
+
if selector:
|
|
758
|
+
params['selector'] = selector
|
|
759
|
+
return self._request(
|
|
760
|
+
path,
|
|
761
|
+
data=None,
|
|
762
|
+
params=params,
|
|
763
|
+
headers=headers
|
|
764
|
+
)
|
|
765
|
+
|
|
766
|
+
@sp_endpoint('/amc/models/v1/trainedModelInferenceJobs', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
767
|
+
def create_trained_model_inference_job(self, body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
768
|
+
r"""
|
|
769
|
+
create_trained_model_inference_job(body: dict, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
770
|
+
|
|
771
|
+
Create a trained model inference job (operationId: CreateTrainedModelInferenceJob)
|
|
772
|
+
|
|
773
|
+
Query Parameters
|
|
774
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
775
|
+
|
|
776
|
+
Request Body (application/vnd.amcmodelbasedaudience.v{version}+json)
|
|
777
|
+
| **trainedModelId** (string) [required] Trained model identifier
|
|
778
|
+
| **name** (string) [required] Name of the inference job
|
|
779
|
+
| **mlInputChannelId** (string) [required] ML input channel identifier
|
|
780
|
+
| **resourceConfig** (object) [required] Inference resource configuration
|
|
781
|
+
| **instanceCount** (integer) [optional] Default 1, max 10
|
|
782
|
+
| **instanceType** (string) [optional]
|
|
783
|
+
| **enforceUserLevelTargeting** (boolean) [required]
|
|
784
|
+
| **configuredModelAlgorithmAssociationArn** (string) [optional] ARN of configured model algorithm association
|
|
785
|
+
| **description** (string) [optional] Description of the inference job
|
|
786
|
+
| **enforceAnonymizedResults** (boolean) [optional] Default false
|
|
787
|
+
| **environment** (object) [optional] Environment variables for Docker container
|
|
788
|
+
| **idempotencyKey** (string) [optional] Prevent duplicate records
|
|
789
|
+
| **containerExecutionParameters** (object) [optional] Container execution params
|
|
790
|
+
| **maxPayloadInMb** (integer) [optional] Min 1, max 100
|
|
791
|
+
|
|
792
|
+
Headers
|
|
793
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
794
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
795
|
+
|
|
796
|
+
Returns
|
|
797
|
+
ApiResponse
|
|
798
|
+
| **trainedModelInferenceJobId** (string)
|
|
799
|
+
|
|
800
|
+
"""
|
|
801
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
802
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
803
|
+
path = kwargs.pop('path')
|
|
804
|
+
params = dict(kwargs)
|
|
805
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
806
|
+
if selector:
|
|
807
|
+
params['selector'] = selector
|
|
808
|
+
return self._request(
|
|
809
|
+
path,
|
|
810
|
+
data=Utils.convert_body(body, False),
|
|
811
|
+
params=params,
|
|
812
|
+
headers=headers
|
|
813
|
+
)
|
|
814
|
+
|
|
815
|
+
@sp_endpoint('/amc/models/v1/trainedModelInferenceJobs/list', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
816
|
+
def list_trained_model_inference_jobs(self, amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None, **kwargs) -> ApiResponse:
|
|
817
|
+
r"""
|
|
818
|
+
list_trained_model_inference_jobs(amazon_marketing_cloud_instance_id: str, version: str = "1", max_results: int = 100, next_token: str = None, selector=None) -> ApiResponse
|
|
819
|
+
|
|
820
|
+
List trained model inference jobs (operationId: ListTrainedModelInferenceJobByInstanceId)
|
|
821
|
+
|
|
822
|
+
Query Parameters
|
|
823
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
824
|
+
| **maxResults** (integer) [optional] Min 1, max 100. Default 100
|
|
825
|
+
| **nextToken** (string) [optional] Token to retrieve subsequent page
|
|
826
|
+
|
|
827
|
+
Headers
|
|
828
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
829
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
830
|
+
|
|
831
|
+
Returns
|
|
832
|
+
ApiResponse
|
|
833
|
+
| **trainedModelInferenceJobs** (array) List of inference job metadata
|
|
834
|
+
|
|
835
|
+
"""
|
|
836
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
837
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
838
|
+
path = kwargs.pop('path')
|
|
839
|
+
params = dict(kwargs)
|
|
840
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
841
|
+
params['maxResults'] = max_results
|
|
842
|
+
if next_token:
|
|
843
|
+
params['nextToken'] = next_token
|
|
844
|
+
if selector:
|
|
845
|
+
params['selector'] = selector
|
|
846
|
+
return self._request(
|
|
847
|
+
path,
|
|
848
|
+
data=None,
|
|
849
|
+
params=params,
|
|
850
|
+
headers=headers
|
|
851
|
+
)
|
|
852
|
+
|
|
853
|
+
@sp_endpoint('/amc/models/v1/trainedModelInferenceJobs/{}', method='GET', headers=['Amazon-Ads-AccountId'])
|
|
854
|
+
def get_trained_model_inference_job(self, trained_model_inference_job_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
855
|
+
r"""
|
|
856
|
+
get_trained_model_inference_job(trained_model_inference_job_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
857
|
+
|
|
858
|
+
Get trained model inference job metadata (operationId: GetTrainedModelInferenceJob)
|
|
859
|
+
|
|
860
|
+
Path Parameters
|
|
861
|
+
| **trainedModelInferenceJobId** (string) [required] Inference job identifier
|
|
862
|
+
|
|
863
|
+
Query Parameters
|
|
864
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
865
|
+
|
|
866
|
+
Headers
|
|
867
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
868
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
869
|
+
|
|
870
|
+
Returns
|
|
871
|
+
ApiResponse
|
|
872
|
+
| **trainedModelInferenceJob** (object) Inference job metadata
|
|
873
|
+
|
|
874
|
+
"""
|
|
875
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
876
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
877
|
+
path = fill_query_params(kwargs.pop('path'), trained_model_inference_job_id)
|
|
878
|
+
params = dict(kwargs)
|
|
879
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
880
|
+
if selector:
|
|
881
|
+
params['selector'] = selector
|
|
882
|
+
return self._request(
|
|
883
|
+
path,
|
|
884
|
+
data=None,
|
|
885
|
+
params=params,
|
|
886
|
+
headers=headers
|
|
887
|
+
)
|
|
888
|
+
|
|
889
|
+
@sp_endpoint('/amc/models/v1/trainedModelInferenceJobs/{}/cancel', method='POST', headers=['Amazon-Ads-AccountId'])
|
|
890
|
+
def cancel_trained_model_inference_job(self, trained_model_inference_job_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None, **kwargs) -> ApiResponse:
|
|
891
|
+
r"""
|
|
892
|
+
cancel_trained_model_inference_job(trained_model_inference_job_id: str, amazon_marketing_cloud_instance_id: str, version: str = "1", selector=None) -> ApiResponse
|
|
893
|
+
|
|
894
|
+
Cancel a trained model inference job (operationId: CancelTrainedModelInferenceJob)
|
|
895
|
+
|
|
896
|
+
Path Parameters
|
|
897
|
+
| **trainedModelInferenceJobId** (string) [required] Inference job identifier
|
|
898
|
+
|
|
899
|
+
Query Parameters
|
|
900
|
+
| **Amazon-Marketing-Cloud-InstanceId** (string) [required] AMC instance identifier
|
|
901
|
+
|
|
902
|
+
Headers
|
|
903
|
+
| **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
|
|
904
|
+
| **Amazon-Ads-AccountId** (string) [optional] From account_id
|
|
905
|
+
|
|
906
|
+
Returns
|
|
907
|
+
ApiResponse
|
|
908
|
+
| **trainedModelInferenceJobId** (string)
|
|
909
|
+
|
|
910
|
+
"""
|
|
911
|
+
media_type = f'application/vnd.amcmodelbasedaudience.v{version}+json'
|
|
912
|
+
headers = {"Accept": media_type, "Content-Type": media_type}
|
|
913
|
+
path = fill_query_params(kwargs.pop('path'), trained_model_inference_job_id)
|
|
914
|
+
params = dict(kwargs)
|
|
915
|
+
params['Amazon-Marketing-Cloud-InstanceId'] = amazon_marketing_cloud_instance_id
|
|
916
|
+
if selector:
|
|
917
|
+
params['selector'] = selector
|
|
918
|
+
return self._request(
|
|
919
|
+
path,
|
|
920
|
+
data=None,
|
|
921
|
+
params=params,
|
|
922
|
+
headers=headers
|
|
923
|
+
)
|
|
924
|
+
|
ad_api/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.4.
|
|
1
|
+
__version__ = "2.4.3"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
ad_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
ad_api/version.py,sha256=
|
|
3
|
-
ad_api/api/__init__.py,sha256=
|
|
2
|
+
ad_api/version.py,sha256=OPBnVa8RJVtYMGheuiuNN0f5i8tn6elz4XCmUBGelSo,22
|
|
3
|
+
ad_api/api/__init__.py,sha256=CH5_5po5hEVlkSft3nb06fw8tRYw9-vGE3fRFx3dOIE,6228
|
|
4
4
|
ad_api/api/account.py,sha256=jNYwfjW8b0HhqP7PjlMev55aXJP3YIuqWhrxri0Pk4Y,4673
|
|
5
5
|
ad_api/api/account_budgets.py,sha256=jFce5eLWAFK3ydjnYR7_Sv7B0-gHTG5bMTx_TcHyy1A,2319
|
|
6
6
|
ad_api/api/ad_library.py,sha256=nlTMHhqinZF5QKWtXngmwA8reTnG5ChIwQVCs_URUIk,3270
|
|
@@ -80,6 +80,9 @@ ad_api/api/stores.py,sha256=BiwqOldK9zEsNjQzcII1DgBxQkDNsGP20aBx5i5Dmg8,2709
|
|
|
80
80
|
ad_api/api/stream.py,sha256=Ga1VHOR_z2YAZY3kRhDvzwEDad3P260g1lWfc4OAjGk,9338
|
|
81
81
|
ad_api/api/targetable_entities.py,sha256=bbdayyuYOnu1r4FutfmNcT23OtuAa0S_Rws59Z2uQVI,4075
|
|
82
82
|
ad_api/api/validation_configurations.py,sha256=Qaxy_J67Fqw0ecS4f1sK9lGdiOLsq323RXeZO0_2KV0,4092
|
|
83
|
+
ad_api/api/amc/__init__.py,sha256=d4kXMzx3651pY6NykiEG8UJ3bX0aptVWPhJXOFAWuZ4,157
|
|
84
|
+
ad_api/api/amc/administration.py,sha256=H8OE_mYSITYahsGF4BW3u3x8ThNUcA9C0_2dJ-HTzy0,1777
|
|
85
|
+
ad_api/api/amc/custom_models.py,sha256=WoLF3caj3em82DNazhsbuCgp0atymlssllmxKja08j4,43311
|
|
83
86
|
ad_api/api/sb/__init__.py,sha256=APbCAkWM1gzYuhpEUU98XDIKJKJx1NXALjLBXA9zdBU,1538
|
|
84
87
|
ad_api/api/sb/ad_creatives_v4.py,sha256=zQzTivDkGzX3I5ZfCWIlzRUGWfTRsXJZCKQrKMaMDpc,14512
|
|
85
88
|
ad_api/api/sb/ad_groups.py,sha256=W06Fk0CCsuEYen1Bd8obR6aHpOMhk6tGWNWApecw59c,2882
|
|
@@ -195,8 +198,8 @@ ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4
|
|
|
195
198
|
ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
|
|
196
199
|
ad_api/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
197
200
|
ad_api/shared/base_client.py,sha256=zOL_LTh-58URWf3ZDlrwmqXXbd6PX66QF5hrr2p83yY,356
|
|
198
|
-
python_amazon_ad_api-2.4.
|
|
199
|
-
python_amazon_ad_api-2.4.
|
|
200
|
-
python_amazon_ad_api-2.4.
|
|
201
|
-
python_amazon_ad_api-2.4.
|
|
202
|
-
python_amazon_ad_api-2.4.
|
|
201
|
+
python_amazon_ad_api-2.4.3.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
|
|
202
|
+
python_amazon_ad_api-2.4.3.dist-info/METADATA,sha256=fbyfG_NxYcQ7FPTiO-r3u8P9rwe9g1ySFBsEAbm19r4,10678
|
|
203
|
+
python_amazon_ad_api-2.4.3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
204
|
+
python_amazon_ad_api-2.4.3.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
|
|
205
|
+
python_amazon_ad_api-2.4.3.dist-info/RECORD,,
|
|
File without changes
|
{python_amazon_ad_api-2.4.2.dist-info → python_amazon_ad_api-2.4.3.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|