Module adcp.types.generated_poc.pricing_options.time_option

Classes

class Parameters (**data: Any)
Expand source code
class Parameters(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    time_unit: Annotated[
        TimeUnit,
        Field(
            description='The time unit for pricing. Total cost = fixed_price × number of time_units in the campaign flight.'
        ),
    ]
    min_duration: Annotated[
        int | None, Field(description='Minimum booking duration in time_units', ge=1)
    ] = None
    max_duration: Annotated[
        int | None,
        Field(
            description='Maximum booking duration in time_units. Must be >= min_duration when both are present.',
            ge=1,
        ),
    ] = None

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 max_duration : int | None
var min_duration : int | None
var model_config
var time_unitTimeUnit

Inherited members

class TimeBasedPricingOption (**data: Any)
Expand source code
class TimeBasedPricingOption(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    pricing_option_id: Annotated[
        str, Field(description='Unique identifier for this pricing option within the product')
    ]
    pricing_model: Annotated[
        Literal['time'],
        Field(description='Cost per time unit - rate scales with campaign duration'),
    ]
    currency: Annotated[
        str,
        Field(
            description='ISO 4217 currency code',
            examples=['USD', 'EUR', 'GBP', 'JPY'],
            pattern='^[A-Z]{3}$',
        ),
    ]
    fixed_price: Annotated[
        float | None,
        Field(
            description='Cost per time unit. If present, this is fixed pricing. If absent, auction-based.',
            ge=0.0,
        ),
    ] = None
    floor_price: Annotated[
        float | None,
        Field(
            description='Minimum acceptable bid per time unit for auction pricing (mutually exclusive with fixed_price). Bids below this value will be rejected.',
            ge=0.0,
        ),
    ] = None
    price_guidance: Annotated[
        price_guidance_1.PriceGuidance | None,
        Field(description='Optional pricing guidance for auction-based bidding'),
    ] = None
    parameters: Annotated[Parameters, Field(description='Time-based pricing parameters')]
    min_spend_per_package: Annotated[
        float | None,
        Field(
            description='Minimum spend requirement per package using this pricing option, in the specified currency',
            ge=0.0,
        ),
    ] = None

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 currency : str
var fixed_price : float | None
var floor_price : float | None
var min_spend_per_package : float | None
var model_config
var parametersParameters
var price_guidancePriceGuidance | None
var pricing_model : Literal['time']
var pricing_option_id : str

Inherited members

class TimeUnit (*args, **kwds)
Expand source code
class TimeUnit(Enum):
    hour = 'hour'
    day = 'day'
    week = 'week'
    month = 'month'

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 day
var hour
var month
var week