Module adcp.types.generated_poc.governance.check_governance_request

Classes

class AudienceDistribution (**data: Any)
Expand source code
class AudienceDistribution(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    baseline: Annotated[
        Baseline,
        Field(
            description="Population baseline used for index calculation. 'census': national census or equivalent population data. 'platform': the seller's active user base. 'custom': a custom baseline defined by the seller (describe in baseline_description)."
        ),
    ]
    baseline_description: Annotated[
        str | None,
        Field(
            description="Description of the baseline when baseline is 'custom' (e.g., 'US adults 18+ with broadband access')."
        ),
    ] = None
    indices: Annotated[
        dict[Annotated[str, StringConstraints(pattern=r'^[a-z_]+:.+$')], float],
        Field(
            description="Audience index values for the current reporting period. Keys are seller-defined dimension:value strings (e.g., 'age:25-34', 'gender:female', 'income:high'). The protocol does not mandate a taxonomy — dimensions and value labels vary by seller. Values are index relative to the declared baseline (1.0 = at parity, >1.0 = over-indexed, <1.0 = under-indexed)."
        ),
    ]
    cumulative_indices: Annotated[
        dict[Annotated[str, StringConstraints(pattern=r'^[a-z_]+:.+$')], float] | None,
        Field(
            description='Cumulative audience index values since the governed action started. Same key format as indices (dimension:value). Use for detecting sustained bias drift that may not appear in a single reporting period.'
        ),
    ] = 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 baselineBaseline
var baseline_description : str | None
var cumulative_indices : dict[str, float] | None
var indices : dict[str, float]
var model_config

Inherited members

class Baseline (*args, **kwds)
Expand source code
class Baseline(Enum):
    census = 'census'
    platform = 'platform'
    custom = 'custom'

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 census
var custom
var platform
class CheckGovernanceRequest (**data: Any)
Expand source code
class CheckGovernanceRequest(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    adcp_major_version: Annotated[
        int | None,
        Field(
            description="The AdCP major version the buyer's payloads conform to. Sellers validate against their supported major_versions and return VERSION_UNSUPPORTED if unsupported. When omitted, the seller assumes its highest supported version.",
            ge=1,
            le=99,
        ),
    ] = None
    plan_id: Annotated[str, Field(description='Campaign governance plan identifier.')]
    caller: Annotated[AnyUrl, Field(description='URL of the agent making the request.')]
    purchase_type: Annotated[
        purchase_type_1.PurchaseType | None,
        Field(
            description="The type of financial commitment being checked. Determines which budget allocation (if any) to validate against. Defaults to 'media_buy' when omitted."
        ),
    ] = purchase_type_1.PurchaseType.media_buy
    tool: Annotated[
        str | None,
        Field(
            description="The AdCP tool being checked (e.g., 'create_media_buy', 'acquire_rights', 'activate_signal'). Present on intent checks (orchestrator). The governance agent uses the presence of tool+payload to identify an intent check."
        ),
    ] = None
    payload: Annotated[
        dict[str, Any] | None,
        Field(
            description='The full tool arguments as they would be sent to the seller. Present on intent checks. The governance agent can inspect any field to validate against the plan.'
        ),
    ] = None
    governance_context: Annotated[
        str | None,
        Field(
            description='Governance context token from a prior check_governance response. Pass this on subsequent checks for the same governed action so the governance agent can maintain continuity across the lifecycle. In 3.0 governance agents MUST emit a compact JWS per the AdCP JWS profile (see Security — Signed Governance Context); callers persist and forward the value verbatim.',
            max_length=4096,
            min_length=1,
            pattern='^[\\x20-\\x7E]+$',
        ),
    ] = None
    phase: Annotated[
        governance_phase.GovernancePhase | None,
        Field(
            description="The phase of the governed action's lifecycle. 'purchase': initial commitment (create_media_buy, acquire_rights, activate_signal). 'modification': update to existing commitment. 'delivery': periodic delivery or usage 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. Present on execution checks.'),
    ] = 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.",
            max_length=1000,
        ),
    ] = None
    invoice_recipient: Annotated[
        business_entity.BusinessEntity | None,
        Field(
            description='Invoice recipient from the purchase request. MUST be present when the tool payload includes invoice_recipient, so the governance agent can validate billing changes.'
        ),
    ] = None
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = 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 adcp_major_version : int | None
var caller : pydantic.networks.AnyUrl
var contextContextObject | None
var delivery_metricsDeliveryMetrics | None
var extExtensionObject | None
var governance_context : str | None
var invoice_recipientBusinessEntity | 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 purchase_typePurchaseType | 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 governed action 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 governed action 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
    audience_distribution: Annotated[
        AudienceDistribution | None,
        Field(
            description='Actual audience composition during the reporting period. Enables mid-flight drift detection when actual delivery skews from planned audience targeting.'
        ),
    ] = 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 audience_distributionAudienceDistribution | None
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