Module adcp.types.generated_poc.governance.check_governance_request

Classes

class Binding (*args, **kwds)
Expand source code
class Binding(Enum):
    proposed = 'proposed'
    committed = 'committed'

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access::
>>> Color.RED
<Color.RED: 1>
  • value lookup:
>>> Color(1)
<Color.RED: 1>
  • name lookup:
>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var committed
var proposed
class CheckGovernanceRequest (**data: Any)
Expand source code
class CheckGovernanceRequest(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    plan_id: Annotated[str, Field(description='Campaign governance plan identifier.')]
    buyer_campaign_ref: Annotated[
        str,
        Field(
            description="Buyer's campaign identifier. The governance agent tracks state per campaign within a plan."
        ),
    ]
    binding: Annotated[
        Binding,
        Field(
            description="Whether this is an advisory check or a binding commitment. 'proposed': the orchestrator is checking before sending to a seller — no budget is committed. 'committed': the seller is about to execute — the governance agent validates the planned delivery against the plan. Budget is committed later via report_plan_outcome, not on approval."
        ),
    ]
    caller: Annotated[
        AnyUrl,
        Field(
            description='URL of the agent making the request (orchestrator for proposed, seller for committed).'
        ),
    ]
    tool: Annotated[
        str | None,
        Field(
            description="The AdCP tool being checked (e.g., 'create_media_buy', 'get_products'). Expected for proposed checks. The governance agent uses this to apply tool-specific validation rules."
        ),
    ] = None
    payload: Annotated[
        dict[str, Any] | None,
        Field(
            description='The full tool arguments as they would be sent to the seller. Expected for proposed checks. The governance agent can inspect any field to validate against the plan.'
        ),
    ] = None
    governance_context: Annotated[
        governance_context_1.GovernanceContext | None,
        Field(
            description='Normalized governance-relevant fields extracted from the tool payload. When present, the governance agent SHOULD use these fields for plan validation instead of parsing the payload directly. The caller is responsible for extracting these from the tool arguments.'
        ),
    ] = None
    media_buy_id: Annotated[
        str | None,
        Field(
            description="The seller's identifier for the media buy. Expected for committed checks."
        ),
    ] = None
    buyer_ref: Annotated[
        str | None,
        Field(description="The buyer's reference identifier from the create_media_buy request."),
    ] = None
    phase: Annotated[
        governance_phase.GovernancePhase | None,
        Field(
            description="The phase of the media buy lifecycle. 'purchase': initial create_media_buy. 'modification': update_media_buy. 'delivery': periodic delivery reporting. Defaults to 'purchase' if omitted."
        ),
    ] = governance_phase.GovernancePhase.purchase
    planned_delivery: Annotated[
        planned_delivery_1.PlannedDelivery | None,
        Field(
            description="What the seller will actually deliver. For committed checks, this is the seller's interpreted delivery parameters. For proposed checks, the orchestrator may include this if it has computed delivery expectations."
        ),
    ] = None
    delivery_metrics: Annotated[
        DeliveryMetrics | None,
        Field(
            description="Actual delivery performance data. MUST be present for 'delivery' phase. The governance agent compares these metrics against the planned delivery to detect drift."
        ),
    ] = None
    modification_summary: Annotated[
        str | None,
        Field(
            description="Human-readable summary of what changed. SHOULD be present for 'modification' phase."
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so that unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config. Consumers who want strict validation can override with extra='forbid'.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var bindingBinding
var buyer_campaign_ref : str
var buyer_ref : str | None
var caller : pydantic.networks.AnyUrl
var delivery_metricsDeliveryMetrics | None
var governance_contextGovernanceContext | None
var media_buy_id : str | None
var model_config
var modification_summary : str | None
var payload : dict[str, typing.Any] | None
var phaseGovernancePhase | None
var plan_id : str
var planned_deliveryPlannedDelivery | None
var tool : str | None

Inherited members

class DeliveryMetrics (**data: Any)
Expand source code
class DeliveryMetrics(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    reporting_period: Annotated[
        ReportingPeriod, Field(description='Start and end timestamps for the reporting window.')
    ]
    spend: Annotated[
        float | None, Field(description='Total spend during the reporting period.', ge=0.0)
    ] = None
    cumulative_spend: Annotated[
        float | None, Field(description='Total spend since the media buy started.', ge=0.0)
    ] = None
    impressions: Annotated[
        int | None, Field(description='Impressions delivered during the reporting period.', ge=0)
    ] = None
    cumulative_impressions: Annotated[
        int | None, Field(description='Total impressions since the media buy started.', ge=0)
    ] = None
    geo_distribution: Annotated[
        dict[str, float] | None,
        Field(
            description='Actual geographic distribution. Keys are ISO 3166-1 alpha-2 codes, values are percentages.'
        ),
    ] = None
    channel_distribution: Annotated[
        dict[str, float] | None,
        Field(
            description='Actual channel distribution. Keys are channel enum values, values are percentages.'
        ),
    ] = None
    pacing: Annotated[
        Pacing | None,
        Field(
            description='Whether delivery is ahead of, on track with, or behind the planned pace.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so that unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config. Consumers who want strict validation can override with extra='forbid'.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var channel_distribution : dict[str, float] | None
var cumulative_impressions : int | None
var cumulative_spend : float | None
var geo_distribution : dict[str, float] | None
var impressions : int | None
var model_config
var pacingPacing | None
var reporting_periodReportingPeriod
var spend : float | None

Inherited members

class Pacing (*args, **kwds)
Expand source code
class Pacing(Enum):
    ahead = 'ahead'
    on_track = 'on_track'
    behind = 'behind'

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access::
>>> Color.RED
<Color.RED: 1>
  • value lookup:
>>> Color(1)
<Color.RED: 1>
  • name lookup:
>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var ahead
var behind
var on_track
class ReportingPeriod (**data: Any)
Expand source code
class ReportingPeriod(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    start: AwareDatetime
    end: AwareDatetime

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so that unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config. Consumers who want strict validation can override with extra='forbid'.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var end : pydantic.types.AwareDatetime
var model_config
var start : pydantic.types.AwareDatetime

Inherited members