Module adcp.types.domains.media_buy.acceptance_policy_profile

Classes

class AcceptancePolicyProfile (**data: Any)
Expand source code
class AcceptancePolicyProfile(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    profile_id: Annotated[str, Field(pattern='^[A-Za-z0-9_.:-]+$')]
    version: Annotated[str, Field(min_length=1)]
    content_digest: Annotated[
        str,
        Field(
            description='SHA-256 digest of the RFC 8785 JCS serialization of this profile with content_digest omitted. A profile_id/version pair is immutable; consumers reject a resolved profile whose digest differs.',
            pattern='^sha256:[a-f0-9]{64}$',
        ),
    ]
    policy_refs: Annotated[
        list[PolicyRef],
        Field(
            description='Exact registry policy versions from which this profile was derived. Consumers MUST NOT silently substitute a different version.',
            min_length=1,
        ),
    ]
    coverage: Annotated[
        Coverage,
        Field(
            description='partial means additional unpublished rules may apply and omission is unknown. complete means this profile is exhaustive only for its declared scope and version.'
        ),
    ]
    scope: Annotated[
        Scope | None,
        Field(
            description='The boundary within which a complete profile claims exhaustiveness. It is informative for partial profiles and mandatory for complete profiles.'
        ),
    ] = None
    region_aliases: Annotated[
        dict[Annotated[str, StringConstraints(pattern=r'^[A-Z][A-Z0-9_-]*$')], list[RegionAliase]] | None,
        Field(
            description='Profile-local named country groups. Rules may reference only keys declared here; consumers expand them before matching.'
        ),
    ] = None
    description: Annotated[str | None, Field(min_length=1)] = None
    rules: Annotated[list[acceptance_policy_rule.AcceptancePolicyRule], Field(min_length=1)]
    ext: ext_1.ExtensionObject | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so 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.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

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 content_digest : str
var coverage : Coverage
var description : str | None
var ext : ExtensionObject | None
var model_config
var policy_refs : list[PolicyRef]
var profile_id : str
var region_aliases : dict[str, list[RegionAliase]] | None
var rules : list[AcceptancePolicyRule]
var scope : Scope | None
var version : str

Inherited members

class AppliesToEnum (*args, **kwds)
Expand source code
class AppliesToEnum(StrEnum):
    account = 'account'
    media_buy = 'media_buy'
    creative = 'creative'
    landing_page = 'landing_page'
    targeting = 'targeting'
    delivery = 'delivery'
    format = 'format'  # type: ignore[assignment]

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var account
var creative
var delivery
var format
var landing_page
var media_buy
var targeting
class Coverage (*args, **kwds)
Expand source code
class Coverage(StrEnum):
    partial = 'partial'
    complete = 'complete'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var complete
var partial
class Jurisdiction (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class Jurisdiction(ScalarStr):
    __slots__ = ()
    _constraints = {'pattern': '^[A-Z]{2}$'}

A str generated from a JSON Schema string root.

Ancestors

  • adcp.types._scalar.ScalarStr
  • adcp.types._scalar._ScalarRoot
  • builtins.str

Subclasses

class JurisdictionGroup (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class JurisdictionGroup(ScalarStr):
    __slots__ = ()
    _constraints = {'pattern': '^[A-Z][A-Z0-9_-]*$'}

A str generated from a JSON Schema string root.

Ancestors

  • adcp.types._scalar.ScalarStr
  • adcp.types._scalar._ScalarRoot
  • builtins.str
class PolicyRef (**data: Any)
Expand source code
class PolicyRef(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    policy_id: Annotated[str, Field(min_length=1)]
    version: Annotated[str, Field(min_length=1)]
    content_digest: Annotated[
        str,
        Field(
            description="SHA-256 digest of the referenced policy entry's RFC 8785 JCS serialization with acceptance_profile omitted.",
            pattern='^sha256:[a-f0-9]{64}$',
        ),
    ]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so 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.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

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 content_digest : str
var model_config
var policy_id : str
var version : str

Inherited members

class RegionAliase (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class RegionAliase(Jurisdiction):
    pass

A str generated from a JSON Schema string root.

Ancestors

  • Jurisdiction
  • adcp.types._scalar.ScalarStr
  • adcp.types._scalar._ScalarRoot
  • builtins.str
class Scope (**data: Any)
Expand source code
class Scope(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    subject_categories: Annotated[list[SubjectCategory], Field(min_length=1)]
    applies_to: Annotated[list[AppliesToEnum], Field(min_length=1)]
    jurisdictions: Annotated[list[Jurisdiction] | None, Field(min_length=1)] = None
    jurisdiction_groups: Annotated[
        list[JurisdictionGroup] | None,
        Field(description="Named groups declared in this profile's region_aliases.", min_length=1),
    ] = None
    all_jurisdictions: Annotated[
        Literal[True] | None,
        Field(
            description='Explicitly states that the scope is not limited by delivery jurisdiction.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so 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.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

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 all_jurisdictions : Literal[True] | None
var applies_to : list[AppliesToEnum]
var jurisdiction_groups : list[JurisdictionGroup] | None
var jurisdictions : list[Jurisdiction] | None
var model_config
var subject_categories : list[SubjectCategory]

Inherited members

class SubjectCategory (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class SubjectCategory(ScalarStr):
    __slots__ = ()
    _constraints = {'pattern': '^[a-z][a-z0-9_]*$'}

A str generated from a JSON Schema string root.

Ancestors

  • adcp.types._scalar.ScalarStr
  • adcp.types._scalar._ScalarRoot
  • builtins.str