Skip to content

Commit aabb322

Browse files
committed
fix: format
1 parent 1dca6f1 commit aabb322

File tree

4 files changed

+15
-36
lines changed

4 files changed

+15
-36
lines changed

src/adcp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
ListCreativeFormatsResponse,
102102
ListCreativesRequest,
103103
ListCreativesResponse,
104+
McpWebhookPayload,
104105
MediaBuy,
105106
MediaBuyStatus,
106107
Package,
@@ -170,7 +171,6 @@
170171
UrlPreviewRender,
171172
UrlVastAsset,
172173
)
173-
from adcp.types import McpWebhookPayload
174174
from adcp.types.core import AgentConfig, Protocol, TaskResult, TaskStatus, WebhookMetadata
175175
from adcp.validation import (
176176
ValidationError,

src/adcp/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from pydantic import BaseModel
1616

1717
from adcp.exceptions import ADCPWebhookSignatureError
18-
from adcp.types.generated_poc.core.async_response_data import AdcpAsyncResponseData
1918
from adcp.protocols.a2a import A2AAdapter
2019
from adcp.protocols.base import ProtocolAdapter
2120
from adcp.protocols.mcp import MCPAdapter
@@ -56,6 +55,7 @@
5655
TaskResult,
5756
TaskStatus,
5857
)
58+
from adcp.types.generated_poc.core.async_response_data import AdcpAsyncResponseData
5959
from adcp.utils.operation_id import create_operation_id
6060

6161
logger = logging.getLogger(__name__)
@@ -1028,8 +1028,8 @@ async def _handle_a2a_webhook(
10281028
10291029
Per A2A specification:
10301030
- Terminated statuses (completed, failed): Payload is Task with artifacts[].parts[]
1031-
- Intermediate statuses (working, input-required, submitted): Payload is TaskStatusUpdateEvent
1032-
with status.message.parts[]
1031+
- Intermediate statuses (working, input-required, submitted):
1032+
Payload is TaskStatusUpdateEvent with status.message.parts[]
10331033
10341034
Args:
10351035
payload: A2A Task or TaskStatusUpdateEvent object

src/adcp/types/__init__.py

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616

1717
# Import all types from generated code
1818
from adcp.types._generated import (
19-
# Core request/response types
2019
ActivateSignalRequest,
2120
ActivateSignalResponse,
2221
AggregatedTotals,
23-
# Assets
2422
Asset,
2523
AssetContentType,
2624
AssetSelectors,
@@ -41,7 +39,6 @@
4139
Colors,
4240
Contact,
4341
Country,
44-
# Pricing options
4542
CpcPricingOption,
4643
CpcvPricingOption,
4744
CpmAuctionPricingOption,
@@ -59,7 +56,6 @@
5956
CreativeFilters,
6057
CreativeManifest,
6158
CreativePolicy,
62-
# Enums and constants
6359
CreativeStatus,
6460
CssAsset,
6561
DaastTrackingEvent,
@@ -195,77 +191,54 @@
195191
WebhookAsset,
196192
WebhookResponseType,
197193
)
198-
from adcp.types._generated import (
199-
TaskStatus as GeneratedTaskStatus,
200-
)
201-
from adcp.types._generated import (
202-
_PackageFromPackage as Package,
203-
)
194+
from adcp.types._generated import TaskStatus as GeneratedTaskStatus
195+
from adcp.types._generated import _PackageFromPackage as Package
204196

205197
# Import semantic aliases for discriminated unions
206198
from adcp.types.aliases import (
207-
# Activation responses
208199
ActivateSignalErrorResponse,
209200
ActivateSignalSuccessResponse,
210-
# Agent deployment aliases
211201
AgentDeployment,
212202
AgentDestination,
213-
# Authorized agent variants
214203
AuthorizedAgent,
215204
AuthorizedAgentsByInlineProperties,
216205
AuthorizedAgentsByPropertyId,
217206
AuthorizedAgentsByPropertyTag,
218207
AuthorizedAgentsByPublisherProperties,
219-
# Preview/render aliases
220208
BothPreviewRender,
221-
# Build creative responses
222209
BuildCreativeErrorResponse,
223210
BuildCreativeSuccessResponse,
224-
# Create media buy responses
225211
CreateMediaBuyErrorResponse,
226212
CreateMediaBuySuccessResponse,
227-
# Deployment union
228213
Deployment,
229-
# Destination union
230214
Destination,
231-
# Preview renders
232215
HtmlPreviewRender,
233-
# Asset aliases
234216
InlineDaastAsset,
235217
InlineVastAsset,
236-
# SubAsset aliases
237218
MediaSubAsset,
238-
# Platform deployment
239219
PlatformDeployment,
240220
PlatformDestination,
241-
# Preview requests
242221
PreviewCreativeFormatRequest,
243222
PreviewCreativeInteractiveResponse,
244223
PreviewCreativeManifestRequest,
245224
PreviewCreativeStaticResponse,
246-
# Publisher property selectors
247225
PropertyId,
248226
PropertyIdActivationKey,
249227
PropertyTag,
250228
PropertyTagActivationKey,
251229
ProvidePerformanceFeedbackErrorResponse,
252230
ProvidePerformanceFeedbackSuccessResponse,
253-
# Publisher properties variants
254231
PublisherPropertiesAll,
255232
PublisherPropertiesById,
256233
PublisherPropertiesByTag,
257-
# Sync responses
234+
SyncCreativeResult,
258235
SyncCreativesErrorResponse,
259236
SyncCreativesSuccessResponse,
260-
SyncCreativeResult,
261-
# Text subassets
262237
TextSubAsset,
263-
# Update media buy variants
264238
UpdateMediaBuyErrorResponse,
265239
UpdateMediaBuyPackagesRequest,
266240
UpdateMediaBuyPropertiesRequest,
267241
UpdateMediaBuySuccessResponse,
268-
# URL aliases
269242
UrlDaastAsset,
270243
UrlPreviewRender,
271244
UrlVastAsset,

src/adcp/webhooks.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def get_adcp_signed_headers_for_webhook(
156156
157157
Examples:
158158
Sign and send an MCP webhook:
159-
>>> from adcp.webhooks import create_mcp_webhook_payload, get_adcp_signed_headers_for_webhook
159+
>>> from adcp.webhooks import create_mcp_webhook_payload get_adcp_signed_headers_for_webhook
160160
>>> from datetime import datetime, timezone
161161
>>>
162162
>>> payload = create_mcp_webhook_payload(
@@ -270,7 +270,13 @@ def extract_webhook_result_data(webhook_payload: dict[str, Any]) -> AdcpAsyncRes
270270
... {
271271
... "artifact_id": "artifact_456",
272272
... "parts": [
273-
... {"data": {"media_buy_id": "mb_456", "buyer_ref": "ref_456", "packages": []}}
273+
... {
274+
... "data": {
275+
... "media_buy_id": "mb_456",
276+
... "buyer_ref": "ref_456",
277+
... "packages": []
278+
... }
279+
... }
274280
... ]
275281
... }
276282
... ]

0 commit comments

Comments
 (0)