Module adcp.types.domains.pricing_options.price_breakdown

Classes

class Adjustment (**data: Any)
Expand source code
class Adjustment(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    kind: adjustment_kind.PriceAdjustmentKind
    name: Annotated[
        str,
        Field(
            description='Specific adjustment name. Use well-known values where applicable for interoperability.',
            examples=[
                'ad_serving',
                'data_targeting',
                'brand_safety',
                'volume',
                'negotiated',
                'early_booking',
                'agency',
                'intermediary',
                'cash_discount',
                'early_payment',
            ],
            max_length=64,
        ),
    ]
    rate: Annotated[
        StrictFloat | None,
        Field(
            description='Adjustment as a decimal proportion (e.g., 0.15 for 15%). Always positive — kind determines the economic effect. Mutually exclusive with amount.',
            gt=0.0,
            lt=1.0,
        ),
    ] = None
    amount: Annotated[
        StrictFloat | None,
        Field(
            description="Adjustment as a fixed monetary amount in the pricing option's currency. Always positive — kind determines the economic effect. Mutually exclusive with rate.",
            gt=0.0,
        ),
    ] = None
    description: Annotated[
        str | None,
        Field(
            description="Human-readable description of this adjustment (e.g., 'Malstaffel 12x', '2% Skonto 10 Tage')",
            max_length=256,
        ),
    ] = None
    beneficiary: Annotated[
        str | None,
        Field(
            description="Identifies who receives this adjustment's value. For commissions, the intermediary (e.g., a sellers.json domain, an AdCP account ID, or a human-readable party name). Optional but recommended for multi-intermediary transparency.",
            max_length=256,
        ),
    ] = 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 amount : float | None
var beneficiary : str | None
var description : str | None
var kind : PriceAdjustmentKind
var model_config
var name : str
var rate : float | None

Inherited members

class PriceBreakdown (**data: Any)
Expand source code
class PriceBreakdown(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    list_price: Annotated[
        StrictFloat,
        Field(
            description='Rate card or base price before any adjustments. The starting point from which fixed_price is derived by applying fee and discount adjustments sequentially.',
            gt=0.0,
        ),
    ]
    adjustments: Annotated[
        list[Adjustment],
        Field(
            description="Ordered list of price adjustments. Fee and discount adjustments walk list_price to fixed_price — fees increase the running price, discounts reduce it. Commission and settlement adjustments are disclosed for transparency but do not affect the buyer's committed price.",
            max_length=20,
            min_length=1,
        ),
    ]

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 adjustments : list[Adjustment]
var list_price : float
var model_config

Inherited members