Module adcp.types.generated_poc.tmp.provider_registration

Classes

class Country (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class Country(RootModel[str]):
    root: Annotated[str, Field(pattern='^[A-Z]{2}$')]

Usage Documentation

RootModel and Custom Root Types

A Pydantic BaseModel for the root object of the model.

Attributes

root
The root object of the model.
__pydantic_root_model__
Whether the model is a RootModel.
__pydantic_private__
Private fields in the model.
__pydantic_extra__
Extra fields in the model.

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

  • pydantic.root_model.RootModel[str]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var root : str
class Status (*args, **kwds)
Expand source code
class Status(Enum):
    active = 'active'
    inactive = 'inactive'
    draining = 'draining'

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 active
var draining
var inactive
class TmpProviderRegistration (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class TmpProviderRegistration(RootModel[TmpProviderRegistration1 | TmpProviderRegistration2]):
    root: Annotated[
        TmpProviderRegistration1 | TmpProviderRegistration2,
        Field(
            description="Declares a TMP provider's endpoint, capabilities, and operational parameters. Used in router configuration (static YAML or dynamic API) and referenced by product-level provider entries. The publisher controls which providers participate in their ad decisioning. Endpoint URLs MUST be validated against SSRF, and dynamic registration endpoints MUST authenticate callers — see docs/trusted-match/specification#provider-registration-security.",
            title='TMP Provider Registration',
        ),
    ]

    def __getattr__(self, name: str) -> Any:
        """Proxy attribute access to the wrapped type."""
        if name.startswith('_'):
            raise AttributeError(name)
        return getattr(self.root, name)

Usage Documentation

RootModel and Custom Root Types

A Pydantic BaseModel for the root object of the model.

Attributes

root
The root object of the model.
__pydantic_root_model__
Whether the model is a RootModel.
__pydantic_private__
Private fields in the model.
__pydantic_extra__
Extra fields in the model.

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

  • pydantic.root_model.RootModel[Union[TmpProviderRegistration1, TmpProviderRegistration2]]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var rootTmpProviderRegistration1 | TmpProviderRegistration2
class TmpProviderRegistration1 (**data: Any)
Expand source code
class TmpProviderRegistration1(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    provider_id: Annotated[
        str,
        Field(
            description="Stable identifier for this provider registration. Used in logs, metrics, and cache keys. Publishers assign this — it is not the provider's agent_url."
        ),
    ]
    endpoint: Annotated[
        AnyUrl,
        Field(
            description='Base URL the router calls. The router appends /context for Context Match and /identity for Identity Match. MUST be HTTPS in production, validated against the canonical reserved IPv4 and IPv6 ranges, with the TCP connection pinned to the validated IP (DNS re-resolution alone is insufficient against rebinding). See docs/trusted-match/specification#provider-registration-security and docs/building/implementation/security#webhook-url-validation-ssrf.'
        ),
    ]
    context_match: Annotated[
        Literal[True], Field(description='Provider handles Context Match requests (POST /context).')
    ]
    identity_match: Annotated[
        bool | None, Field(description='Provider handles Identity Match requests (POST /identity).')
    ] = None
    countries: Annotated[
        list[Country] | None,
        Field(
            description="ISO 3166-1 alpha-2 country codes this provider serves. The router filters Identity Match providers by the request's country field. MUST be present and non-empty when identity_match is true.",
            min_length=1,
        ),
    ] = None
    uid_types: Annotated[
        list[uid_type.UidType] | None,
        Field(
            description="Identity types this provider can resolve. The router selects Identity Match providers whose uid_types overlaps with any uid_type in the request's identities array. MUST be present and non-empty when identity_match is true.",
            min_length=1,
        ),
    ] = None
    properties: Annotated[
        list[UUID] | None,
        Field(
            description='Property RIDs (UUID v7) this provider serves. When present, the router only sends requests from these properties to this provider. When absent, the provider serves all properties.',
            min_length=1,
        ),
    ] = None
    timeout_ms: Annotated[
        int | None,
        Field(
            description="Per-provider timeout in milliseconds. The router skips this provider if it does not respond within this budget. Must be less than or equal to the router's overall latency_budget_ms. The router may further reduce this based on adaptive timeout allocation.",
            ge=5,
            le=5000,
        ),
    ] = 50
    priority: Annotated[
        int | None,
        Field(
            description='Provider ordering for merge conflict resolution. Lower values have higher priority. When two providers return offers for the same package_id (a configuration error), the router keeps the offer from the higher-priority provider. Also used for adaptive timeout allocation — higher-priority providers receive a larger share of the latency budget.',
            ge=0,
        ),
    ] = 0
    status: Annotated[
        Status | None,
        Field(
            description='Provider lifecycle status. Active providers receive requests. Inactive providers are skipped entirely. Draining providers stop receiving new requests but in-flight requests complete normally.'
        ),
    ] = Status.active

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 context_match : Literal[True]
var countries : list[Country] | None
var endpoint : pydantic.networks.AnyUrl
var identity_match : bool | None
var model_config
var priority : int | None
var properties : list[uuid.UUID] | None
var provider_id : str
var statusStatus | None
var timeout_ms : int | None
var uid_types : list[UidType] | None

Inherited members

class TmpProviderRegistration2 (**data: Any)
Expand source code
class TmpProviderRegistration2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    provider_id: Annotated[
        str,
        Field(
            description="Stable identifier for this provider registration. Used in logs, metrics, and cache keys. Publishers assign this — it is not the provider's agent_url."
        ),
    ]
    endpoint: Annotated[
        AnyUrl,
        Field(
            description='Base URL the router calls. The router appends /context for Context Match and /identity for Identity Match. MUST be HTTPS in production, validated against the canonical reserved IPv4 and IPv6 ranges, with the TCP connection pinned to the validated IP (DNS re-resolution alone is insufficient against rebinding). See docs/trusted-match/specification#provider-registration-security and docs/building/implementation/security#webhook-url-validation-ssrf.'
        ),
    ]
    context_match: Annotated[
        bool | None, Field(description='Provider handles Context Match requests (POST /context).')
    ] = None
    identity_match: Annotated[
        Literal[True],
        Field(description='Provider handles Identity Match requests (POST /identity).'),
    ]
    countries: Annotated[
        list[Country] | None,
        Field(
            description="ISO 3166-1 alpha-2 country codes this provider serves. The router filters Identity Match providers by the request's country field. MUST be present and non-empty when identity_match is true.",
            min_length=1,
        ),
    ] = None
    uid_types: Annotated[
        list[uid_type.UidType] | None,
        Field(
            description="Identity types this provider can resolve. The router selects Identity Match providers whose uid_types overlaps with any uid_type in the request's identities array. MUST be present and non-empty when identity_match is true.",
            min_length=1,
        ),
    ] = None
    properties: Annotated[
        list[UUID] | None,
        Field(
            description='Property RIDs (UUID v7) this provider serves. When present, the router only sends requests from these properties to this provider. When absent, the provider serves all properties.',
            min_length=1,
        ),
    ] = None
    timeout_ms: Annotated[
        int | None,
        Field(
            description="Per-provider timeout in milliseconds. The router skips this provider if it does not respond within this budget. Must be less than or equal to the router's overall latency_budget_ms. The router may further reduce this based on adaptive timeout allocation.",
            ge=5,
            le=5000,
        ),
    ] = 50
    priority: Annotated[
        int | None,
        Field(
            description='Provider ordering for merge conflict resolution. Lower values have higher priority. When two providers return offers for the same package_id (a configuration error), the router keeps the offer from the higher-priority provider. Also used for adaptive timeout allocation — higher-priority providers receive a larger share of the latency budget.',
            ge=0,
        ),
    ] = 0
    status: Annotated[
        Status | None,
        Field(
            description='Provider lifecycle status. Active providers receive requests. Inactive providers are skipped entirely. Draining providers stop receiving new requests but in-flight requests complete normally.'
        ),
    ] = Status.active

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 context_match : bool | None
var countries : list[Country] | None
var endpoint : pydantic.networks.AnyUrl
var identity_match : Literal[True]
var model_config
var priority : int | None
var properties : list[uuid.UUID] | None
var provider_id : str
var statusStatus | None
var timeout_ms : int | None
var uid_types : list[UidType] | None

Inherited members