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.' ), ] = NoneBase 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config. Consumers who want strict validation can override withextra='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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var baseline : Baselinevar baseline_description : str | Nonevar cumulative_indices : dict[str, float] | Nonevar 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 = 3Access 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 censusvar customvar 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 = NoneBase 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config. Consumers who want strict validation can override withextra='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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var adcp_major_version : int | Nonevar caller : pydantic.networks.AnyUrlvar context : ContextObject | Nonevar delivery_metrics : DeliveryMetrics | Nonevar ext : ExtensionObject | Nonevar governance_context : str | Nonevar invoice_recipient : BusinessEntity | Nonevar model_configvar modification_summary : str | Nonevar payload : dict[str, typing.Any] | Nonevar phase : GovernancePhase | Nonevar plan_id : strvar planned_delivery : PlannedDelivery | Nonevar purchase_type : PurchaseType | Nonevar 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.' ), ] = NoneBase 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config. Consumers who want strict validation can override withextra='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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var audience_distribution : AudienceDistribution | Nonevar channel_distribution : dict[str, float] | Nonevar cumulative_impressions : int | Nonevar cumulative_spend : float | Nonevar geo_distribution : dict[str, float] | Nonevar impressions : int | Nonevar model_configvar pacing : Pacing | Nonevar reporting_period : ReportingPeriodvar 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 = 3Access 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 aheadvar behindvar on_track
class ReportingPeriod (**data: Any)-
Expand source code
class ReportingPeriod(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) start: AwareDatetime end: AwareDatetimeBase 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config. Consumers who want strict validation can override withextra='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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var end : pydantic.types.AwareDatetimevar model_configvar start : pydantic.types.AwareDatetime
Inherited members