amazon-ads-mcp 0.2.7__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.
- amazon_ads_mcp/__init__.py +11 -0
- amazon_ads_mcp/auth/__init__.py +33 -0
- amazon_ads_mcp/auth/base.py +211 -0
- amazon_ads_mcp/auth/hooks.py +172 -0
- amazon_ads_mcp/auth/manager.py +791 -0
- amazon_ads_mcp/auth/oauth_state_store.py +277 -0
- amazon_ads_mcp/auth/providers/__init__.py +14 -0
- amazon_ads_mcp/auth/providers/direct.py +393 -0
- amazon_ads_mcp/auth/providers/example_auth0.py.example +216 -0
- amazon_ads_mcp/auth/providers/openbridge.py +512 -0
- amazon_ads_mcp/auth/registry.py +146 -0
- amazon_ads_mcp/auth/secure_token_store.py +297 -0
- amazon_ads_mcp/auth/token_store.py +723 -0
- amazon_ads_mcp/config/__init__.py +5 -0
- amazon_ads_mcp/config/sampling.py +111 -0
- amazon_ads_mcp/config/settings.py +366 -0
- amazon_ads_mcp/exceptions.py +314 -0
- amazon_ads_mcp/middleware/__init__.py +11 -0
- amazon_ads_mcp/middleware/authentication.py +1474 -0
- amazon_ads_mcp/middleware/caching.py +177 -0
- amazon_ads_mcp/middleware/oauth.py +175 -0
- amazon_ads_mcp/middleware/sampling.py +112 -0
- amazon_ads_mcp/models/__init__.py +320 -0
- amazon_ads_mcp/models/amc_models.py +837 -0
- amazon_ads_mcp/models/api_responses.py +847 -0
- amazon_ads_mcp/models/base_models.py +215 -0
- amazon_ads_mcp/models/builtin_responses.py +496 -0
- amazon_ads_mcp/models/dsp_models.py +556 -0
- amazon_ads_mcp/models/stores_brands.py +610 -0
- amazon_ads_mcp/server/__init__.py +6 -0
- amazon_ads_mcp/server/__main__.py +6 -0
- amazon_ads_mcp/server/builtin_prompts.py +269 -0
- amazon_ads_mcp/server/builtin_tools.py +962 -0
- amazon_ads_mcp/server/file_routes.py +547 -0
- amazon_ads_mcp/server/html_templates.py +149 -0
- amazon_ads_mcp/server/mcp_server.py +327 -0
- amazon_ads_mcp/server/openapi_utils.py +158 -0
- amazon_ads_mcp/server/sampling_handler.py +251 -0
- amazon_ads_mcp/server/server_builder.py +751 -0
- amazon_ads_mcp/server/sidecar_loader.py +178 -0
- amazon_ads_mcp/server/transform_executor.py +827 -0
- amazon_ads_mcp/tools/__init__.py +22 -0
- amazon_ads_mcp/tools/cache_management.py +105 -0
- amazon_ads_mcp/tools/download_tools.py +267 -0
- amazon_ads_mcp/tools/identity.py +236 -0
- amazon_ads_mcp/tools/oauth.py +598 -0
- amazon_ads_mcp/tools/profile.py +150 -0
- amazon_ads_mcp/tools/profile_listing.py +285 -0
- amazon_ads_mcp/tools/region.py +320 -0
- amazon_ads_mcp/tools/region_identity.py +175 -0
- amazon_ads_mcp/utils/__init__.py +6 -0
- amazon_ads_mcp/utils/async_compat.py +215 -0
- amazon_ads_mcp/utils/errors.py +452 -0
- amazon_ads_mcp/utils/export_content_type_resolver.py +249 -0
- amazon_ads_mcp/utils/export_download_handler.py +579 -0
- amazon_ads_mcp/utils/header_resolver.py +81 -0
- amazon_ads_mcp/utils/http/__init__.py +56 -0
- amazon_ads_mcp/utils/http/circuit_breaker.py +127 -0
- amazon_ads_mcp/utils/http/client_manager.py +329 -0
- amazon_ads_mcp/utils/http/request.py +207 -0
- amazon_ads_mcp/utils/http/resilience.py +512 -0
- amazon_ads_mcp/utils/http/resilient_client.py +195 -0
- amazon_ads_mcp/utils/http/retry.py +76 -0
- amazon_ads_mcp/utils/http_client.py +873 -0
- amazon_ads_mcp/utils/media/__init__.py +21 -0
- amazon_ads_mcp/utils/media/negotiator.py +243 -0
- amazon_ads_mcp/utils/media/types.py +199 -0
- amazon_ads_mcp/utils/openapi/__init__.py +16 -0
- amazon_ads_mcp/utils/openapi/json.py +55 -0
- amazon_ads_mcp/utils/openapi/loader.py +263 -0
- amazon_ads_mcp/utils/openapi/refs.py +46 -0
- amazon_ads_mcp/utils/region_config.py +200 -0
- amazon_ads_mcp/utils/response_wrapper.py +171 -0
- amazon_ads_mcp/utils/sampling_helpers.py +156 -0
- amazon_ads_mcp/utils/sampling_wrapper.py +173 -0
- amazon_ads_mcp/utils/security.py +630 -0
- amazon_ads_mcp/utils/tool_naming.py +137 -0
- amazon_ads_mcp-0.2.7.dist-info/METADATA +664 -0
- amazon_ads_mcp-0.2.7.dist-info/RECORD +82 -0
- amazon_ads_mcp-0.2.7.dist-info/WHEEL +4 -0
- amazon_ads_mcp-0.2.7.dist-info/entry_points.txt +3 -0
- amazon_ads_mcp-0.2.7.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"""Amazon Ads MCP models package.
|
|
2
|
+
|
|
3
|
+
This package contains all Pydantic models used throughout the Amazon Ads MCP
|
|
4
|
+
server, organized by API domain and functionality.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# Import AMC models
|
|
8
|
+
from .amc_models import ( # Enums; Instance models; Query models; Audience models; Data upload models; Template models; Insight models; Privacy models; Workflow models
|
|
9
|
+
AMCAudience,
|
|
10
|
+
AMCAudienceCreateRequest,
|
|
11
|
+
AMCAudienceListResponse,
|
|
12
|
+
AMCAudienceStatus,
|
|
13
|
+
AMCDataSource,
|
|
14
|
+
AMCDataUpload,
|
|
15
|
+
AMCDataUploadRequest,
|
|
16
|
+
AMCExportFormat,
|
|
17
|
+
AMCInsight,
|
|
18
|
+
AMCInsightListResponse,
|
|
19
|
+
AMCInstance,
|
|
20
|
+
AMCInstanceListResponse,
|
|
21
|
+
AMCInstanceType,
|
|
22
|
+
AMCPrivacyConfig,
|
|
23
|
+
AMCPrivacyLevel,
|
|
24
|
+
AMCQuery,
|
|
25
|
+
AMCQueryExecution,
|
|
26
|
+
AMCQueryExecutionRequest,
|
|
27
|
+
AMCQueryListResponse,
|
|
28
|
+
AMCQueryStatus,
|
|
29
|
+
AMCQueryTemplate,
|
|
30
|
+
AMCQueryTemplateListResponse,
|
|
31
|
+
AMCQueryType,
|
|
32
|
+
AMCWorkflow,
|
|
33
|
+
AMCWorkflowExecution,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Import API response models
|
|
37
|
+
from .api_responses import ( # Base models; Enums; Profile models; Campaign models; Ad group models; Keyword models; Product ad models; Reporting models; Metrics models; Budget models; Error models; Batch models; Generic wrapper
|
|
38
|
+
AdGroup,
|
|
39
|
+
AdGroupListResponse,
|
|
40
|
+
AdGroupMetrics,
|
|
41
|
+
AdGroupState,
|
|
42
|
+
APIError,
|
|
43
|
+
APIErrorResponse,
|
|
44
|
+
APIResponse,
|
|
45
|
+
BaseAPIResponse,
|
|
46
|
+
BatchOperationRequest,
|
|
47
|
+
BatchOperationResponse,
|
|
48
|
+
BidOptimization,
|
|
49
|
+
BudgetRecommendation,
|
|
50
|
+
Campaign,
|
|
51
|
+
CampaignCreateRequest,
|
|
52
|
+
CampaignListResponse,
|
|
53
|
+
CampaignMetrics,
|
|
54
|
+
CampaignState,
|
|
55
|
+
CampaignUpdateRequest,
|
|
56
|
+
Keyword,
|
|
57
|
+
KeywordListResponse,
|
|
58
|
+
MarketplaceId,
|
|
59
|
+
MatchType,
|
|
60
|
+
PaginatedResponse,
|
|
61
|
+
ProductAd,
|
|
62
|
+
ProductAdListResponse,
|
|
63
|
+
Profile,
|
|
64
|
+
ProfileListResponse,
|
|
65
|
+
ProfileType,
|
|
66
|
+
ReportData,
|
|
67
|
+
ReportRequest,
|
|
68
|
+
ReportResponse,
|
|
69
|
+
ReportStatus,
|
|
70
|
+
TargetingType,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
# Import existing models from base_models.py
|
|
74
|
+
from .base_models import ( # Auth models; OpenBridge models; Identity management models
|
|
75
|
+
AuthCredentials,
|
|
76
|
+
Identity,
|
|
77
|
+
IdentityListResponse,
|
|
78
|
+
OpenbridgeIdentity,
|
|
79
|
+
SetActiveIdentityRequest,
|
|
80
|
+
SetActiveIdentityResponse,
|
|
81
|
+
Token,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# Import DSP models
|
|
85
|
+
from .dsp_models import ( # Enums; Order models; Line item models; Creative models; Audience models; Pixel models; Report models; Metrics models
|
|
86
|
+
AudienceType,
|
|
87
|
+
CreativeType,
|
|
88
|
+
DSPAudience,
|
|
89
|
+
DSPAudienceListResponse,
|
|
90
|
+
DSPCreative,
|
|
91
|
+
DSPCreativeListResponse,
|
|
92
|
+
DSPEntityState,
|
|
93
|
+
DSPLineItem,
|
|
94
|
+
DSPLineItemListResponse,
|
|
95
|
+
DSPLineItemMetrics,
|
|
96
|
+
DSPMetrics,
|
|
97
|
+
DSPOrder,
|
|
98
|
+
DSPOrderListResponse,
|
|
99
|
+
DSPOrderMetrics,
|
|
100
|
+
DSPPixel,
|
|
101
|
+
DSPReportRequest,
|
|
102
|
+
DSPReportResponse,
|
|
103
|
+
OrderGoalType,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
# Import builtin tool response models
|
|
107
|
+
from .builtin_responses import ( # Region responses; Profile responses; Download responses; Reporting responses; OAuth responses
|
|
108
|
+
AsyncReportResponse,
|
|
109
|
+
ClearProfileResponse,
|
|
110
|
+
DownloadedFile,
|
|
111
|
+
DownloadExportResponse,
|
|
112
|
+
GetActiveIdentityResponse,
|
|
113
|
+
GetProfileResponse,
|
|
114
|
+
GetRegionResponse,
|
|
115
|
+
ProfileListItem,
|
|
116
|
+
ProfileCacheRefreshResponse,
|
|
117
|
+
ProfilePageResponse,
|
|
118
|
+
ProfileSearchResponse,
|
|
119
|
+
ProfileSelectorResponse,
|
|
120
|
+
ProfileSummaryResponse,
|
|
121
|
+
ListDownloadsResponse,
|
|
122
|
+
ListRegionsResponse,
|
|
123
|
+
OAuthClearResponse,
|
|
124
|
+
OAuthFlowResponse,
|
|
125
|
+
OAuthRefreshResponse,
|
|
126
|
+
OAuthStatusResponse,
|
|
127
|
+
RegionInfo,
|
|
128
|
+
RoutingStateResponse,
|
|
129
|
+
SamplingTestResponse,
|
|
130
|
+
SetProfileResponse,
|
|
131
|
+
SetRegionResponse,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
# Import Stores and Brands models
|
|
135
|
+
from .stores_brands import ( # Enums; Store models; Page models; Content models; Brand models; Analytics models; A+ Content models; Metrics models; Post models; Template models
|
|
136
|
+
APlusContent,
|
|
137
|
+
APlusContentListResponse,
|
|
138
|
+
Brand,
|
|
139
|
+
BrandListResponse,
|
|
140
|
+
BrandMetrics,
|
|
141
|
+
BrandStatus,
|
|
142
|
+
ContentType,
|
|
143
|
+
PageType,
|
|
144
|
+
Post,
|
|
145
|
+
PostListResponse,
|
|
146
|
+
Store,
|
|
147
|
+
StoreAnalytics,
|
|
148
|
+
StoreContent,
|
|
149
|
+
StoreContentListResponse,
|
|
150
|
+
StoreListResponse,
|
|
151
|
+
StorePage,
|
|
152
|
+
StorePageAnalytics,
|
|
153
|
+
StorePageListResponse,
|
|
154
|
+
StoreStatus,
|
|
155
|
+
StoreTemplate,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# Export all models
|
|
159
|
+
__all__ = [
|
|
160
|
+
# Auth models
|
|
161
|
+
"Token",
|
|
162
|
+
"Identity",
|
|
163
|
+
"AuthCredentials",
|
|
164
|
+
# OpenBridge models
|
|
165
|
+
"OpenbridgeIdentity",
|
|
166
|
+
# Identity management models
|
|
167
|
+
"IdentityListResponse",
|
|
168
|
+
"SetActiveIdentityRequest",
|
|
169
|
+
"SetActiveIdentityResponse",
|
|
170
|
+
# Base API models
|
|
171
|
+
"BaseAPIResponse",
|
|
172
|
+
"PaginatedResponse",
|
|
173
|
+
# Enums
|
|
174
|
+
"ProfileType",
|
|
175
|
+
"MarketplaceId",
|
|
176
|
+
"CampaignState",
|
|
177
|
+
"AdGroupState",
|
|
178
|
+
"TargetingType",
|
|
179
|
+
"MatchType",
|
|
180
|
+
"BidOptimization",
|
|
181
|
+
"ReportStatus",
|
|
182
|
+
"DSPEntityState",
|
|
183
|
+
"CreativeType",
|
|
184
|
+
"AudienceType",
|
|
185
|
+
"OrderGoalType",
|
|
186
|
+
"StoreStatus",
|
|
187
|
+
"PageType",
|
|
188
|
+
"BrandStatus",
|
|
189
|
+
"ContentType",
|
|
190
|
+
# Profile models
|
|
191
|
+
"Profile",
|
|
192
|
+
"ProfileListResponse",
|
|
193
|
+
# Campaign models
|
|
194
|
+
"Campaign",
|
|
195
|
+
"CampaignListResponse",
|
|
196
|
+
"CampaignCreateRequest",
|
|
197
|
+
"CampaignUpdateRequest",
|
|
198
|
+
# Ad group models
|
|
199
|
+
"AdGroup",
|
|
200
|
+
"AdGroupListResponse",
|
|
201
|
+
# Keyword models
|
|
202
|
+
"Keyword",
|
|
203
|
+
"KeywordListResponse",
|
|
204
|
+
# Product ad models
|
|
205
|
+
"ProductAd",
|
|
206
|
+
"ProductAdListResponse",
|
|
207
|
+
# Reporting models
|
|
208
|
+
"ReportRequest",
|
|
209
|
+
"ReportResponse",
|
|
210
|
+
"ReportData",
|
|
211
|
+
# Metrics models
|
|
212
|
+
"CampaignMetrics",
|
|
213
|
+
"AdGroupMetrics",
|
|
214
|
+
"DSPMetrics",
|
|
215
|
+
"DSPOrderMetrics",
|
|
216
|
+
"DSPLineItemMetrics",
|
|
217
|
+
"BrandMetrics",
|
|
218
|
+
# Budget models
|
|
219
|
+
"BudgetRecommendation",
|
|
220
|
+
# Error models
|
|
221
|
+
"APIError",
|
|
222
|
+
"APIErrorResponse",
|
|
223
|
+
# Batch models
|
|
224
|
+
"BatchOperationRequest",
|
|
225
|
+
"BatchOperationResponse",
|
|
226
|
+
# Generic wrapper
|
|
227
|
+
"APIResponse",
|
|
228
|
+
# DSP models
|
|
229
|
+
"DSPOrder",
|
|
230
|
+
"DSPOrderListResponse",
|
|
231
|
+
"DSPLineItem",
|
|
232
|
+
"DSPLineItemListResponse",
|
|
233
|
+
"DSPCreative",
|
|
234
|
+
"DSPCreativeListResponse",
|
|
235
|
+
"DSPAudience",
|
|
236
|
+
"DSPAudienceListResponse",
|
|
237
|
+
"DSPPixel",
|
|
238
|
+
"DSPReportRequest",
|
|
239
|
+
"DSPReportResponse",
|
|
240
|
+
# Store models
|
|
241
|
+
"Store",
|
|
242
|
+
"StoreListResponse",
|
|
243
|
+
"StorePage",
|
|
244
|
+
"StorePageListResponse",
|
|
245
|
+
"StoreContent",
|
|
246
|
+
"StoreContentListResponse",
|
|
247
|
+
# Brand models
|
|
248
|
+
"Brand",
|
|
249
|
+
"BrandListResponse",
|
|
250
|
+
# Analytics models
|
|
251
|
+
"StoreAnalytics",
|
|
252
|
+
"StorePageAnalytics",
|
|
253
|
+
# A+ Content models
|
|
254
|
+
"APlusContent",
|
|
255
|
+
"APlusContentListResponse",
|
|
256
|
+
# Post models
|
|
257
|
+
"Post",
|
|
258
|
+
"PostListResponse",
|
|
259
|
+
# Template models
|
|
260
|
+
"StoreTemplate",
|
|
261
|
+
# AMC Enums
|
|
262
|
+
"AMCInstanceType",
|
|
263
|
+
"AMCQueryStatus",
|
|
264
|
+
"AMCQueryType",
|
|
265
|
+
"AMCDataSource",
|
|
266
|
+
"AMCExportFormat",
|
|
267
|
+
"AMCAudienceStatus",
|
|
268
|
+
"AMCPrivacyLevel",
|
|
269
|
+
# AMC Instance models
|
|
270
|
+
"AMCInstance",
|
|
271
|
+
"AMCInstanceListResponse",
|
|
272
|
+
# AMC Query models
|
|
273
|
+
"AMCQuery",
|
|
274
|
+
"AMCQueryExecution",
|
|
275
|
+
"AMCQueryExecutionRequest",
|
|
276
|
+
"AMCQueryListResponse",
|
|
277
|
+
# AMC Audience models
|
|
278
|
+
"AMCAudience",
|
|
279
|
+
"AMCAudienceCreateRequest",
|
|
280
|
+
"AMCAudienceListResponse",
|
|
281
|
+
# AMC Data upload models
|
|
282
|
+
"AMCDataUpload",
|
|
283
|
+
"AMCDataUploadRequest",
|
|
284
|
+
# AMC Template models
|
|
285
|
+
"AMCQueryTemplate",
|
|
286
|
+
"AMCQueryTemplateListResponse",
|
|
287
|
+
# AMC Insight models
|
|
288
|
+
"AMCInsight",
|
|
289
|
+
"AMCInsightListResponse",
|
|
290
|
+
# AMC Privacy models
|
|
291
|
+
"AMCPrivacyConfig",
|
|
292
|
+
# AMC Workflow models
|
|
293
|
+
"AMCWorkflow",
|
|
294
|
+
"AMCWorkflowExecution",
|
|
295
|
+
# Builtin tool response models
|
|
296
|
+
"RegionInfo",
|
|
297
|
+
"SetRegionResponse",
|
|
298
|
+
"GetRegionResponse",
|
|
299
|
+
"ListRegionsResponse",
|
|
300
|
+
"SetProfileResponse",
|
|
301
|
+
"GetProfileResponse",
|
|
302
|
+
"ClearProfileResponse",
|
|
303
|
+
"GetActiveIdentityResponse",
|
|
304
|
+
"ProfileListItem",
|
|
305
|
+
"ProfileCacheRefreshResponse",
|
|
306
|
+
"ProfileSummaryResponse",
|
|
307
|
+
"ProfileSearchResponse",
|
|
308
|
+
"ProfilePageResponse",
|
|
309
|
+
"ProfileSelectorResponse",
|
|
310
|
+
"DownloadExportResponse",
|
|
311
|
+
"DownloadedFile",
|
|
312
|
+
"ListDownloadsResponse",
|
|
313
|
+
"AsyncReportResponse",
|
|
314
|
+
"OAuthFlowResponse",
|
|
315
|
+
"OAuthStatusResponse",
|
|
316
|
+
"OAuthRefreshResponse",
|
|
317
|
+
"OAuthClearResponse",
|
|
318
|
+
"RoutingStateResponse",
|
|
319
|
+
"SamplingTestResponse",
|
|
320
|
+
]
|