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 = NoneBase 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='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 adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport 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_configon 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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var content_digest : strvar coverage : Coveragevar description : str | Nonevar ext : ExtensionObject | Nonevar model_configvar policy_refs : list[PolicyRef]var profile_id : strvar region_aliases : dict[str, list[RegionAliase]] | Nonevar rules : list[AcceptancePolicyRule]var scope : Scope | Nonevar 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 accountvar creativevar deliveryvar formatvar landing_pagevar media_buyvar 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 completevar partial
class Jurisdiction (value: Any = <object object>, *, root: Any = <object object>)-
Expand source code
class Jurisdiction(ScalarStr): __slots__ = () _constraints = {'pattern': '^[A-Z]{2}$'}A
strgenerated 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
strgenerated 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='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 adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport 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_configon 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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var content_digest : strvar model_configvar policy_id : strvar version : str
Inherited members
class RegionAliase (value: Any = <object object>, *, root: Any = <object object>)-
Expand source code
class RegionAliase(Jurisdiction): passA
strgenerated 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.' ), ] = NoneBase 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='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 adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport 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_configon 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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var all_jurisdictions : Literal[True] | Nonevar applies_to : list[AppliesToEnum]var jurisdiction_groups : list[JurisdictionGroup] | Nonevar jurisdictions : list[Jurisdiction] | Nonevar model_configvar 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
strgenerated from a JSON Schema string root.Ancestors
- adcp.types._scalar.ScalarStr
- adcp.types._scalar._ScalarRoot
- builtins.str