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, ), ] = 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 amount : float | Nonevar beneficiary : str | Nonevar description : str | Nonevar kind : PriceAdjustmentKindvar model_configvar name : strvar 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 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 adjustments : list[Adjustment]var list_price : floatvar model_config
Inherited members