Module adcp.types.domains.media_buy.change_term_constraints
Classes
class MediaBuyChangeTermConstraints1 (**data: Any)-
Expand source code
class MediaBuyChangeTermConstraints1(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) kind: Literal['budget'] = 'budget' max_delta_amount: Annotated[ Money | None, Field( description='Maximum absolute amount by which the affected budget may change in the direction named by the action.' ), ] = None max_delta_percent: Annotated[ StrictFloat | None, Field( description='Maximum percentage change relative to the current committed value. Values above 100 are valid for increases greater than the current value.', ge=0.0, ), ] = None min_result_amount: Annotated[ Money | None, Field(description='Minimum resulting committed value after the change.') ] = None max_result_amount: Annotated[ Money | None, Field(description='Maximum resulting committed value after the change.') ] = None @model_validator(mode='after') def _require_portable_bound(self) -> MediaBuyChangeTermConstraints1: if not any(getattr(self, name) is not None for name in ('max_delta_amount', 'max_delta_percent', 'min_result_amount', 'max_result_amount')): raise ValueError('at least one portable constraint bound is required') return selfBase 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 kind : Literal['budget']var max_delta_amount : Money | Nonevar max_delta_percent : float | Nonevar max_result_amount : Money | Nonevar min_result_amount : Money | Nonevar model_config
Inherited members
class MediaBuyChangeTermConstraints2 (**data: Any)-
Expand source code
class MediaBuyChangeTermConstraints2(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) kind: Literal['flight'] = 'flight' max_change: Annotated[ duration.Duration | None, Field( description='Maximum extension, shortening, or shift in the direction named by the action.' ), ] = None earliest_result: Annotated[ AwareDatetime | None, Field(description='Earliest resulting start or end timestamp accepted for this action.'), ] = None latest_result: Annotated[ AwareDatetime | None, Field(description='Latest resulting start or end timestamp accepted for this action.'), ] = None minimum_notice: Annotated[ duration.Duration | None, Field( description='Minimum elapsed notice before the requested flight change may take effect.' ), ] = None @model_validator(mode='after') def _require_portable_bound(self) -> MediaBuyChangeTermConstraints2: if not any(getattr(self, name) is not None for name in ('max_change', 'earliest_result', 'latest_result', 'minimum_notice')): raise ValueError('at least one portable constraint bound is required') return selfBase 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 earliest_result : pydantic.types.AwareDatetime | Nonevar kind : Literal['flight']var latest_result : pydantic.types.AwareDatetime | Nonevar max_change : Duration | Nonevar minimum_notice : Duration | Nonevar model_config
Inherited members
class MediaBuyChangeTermConstraints3 (**data: Any)-
Expand source code
class MediaBuyChangeTermConstraints3(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) kind: Literal['package_count'] = 'package_count' max_additions: Annotated[ SchemaInt | None, Field(description='Maximum packages that may be added by one exercise of the right.', ge=0), ] = None max_removals: Annotated[ SchemaInt | None, Field( description='Maximum packages that may be removed by one exercise of the right.', ge=0 ), ] = None max_result_count: Annotated[ SchemaInt | None, Field(description='Maximum active package count after the change.', ge=0) ] = None @model_validator(mode='after') def _require_portable_bound(self) -> MediaBuyChangeTermConstraints3: if not any(getattr(self, name) is not None for name in ('max_additions', 'max_removals', 'max_result_count')): raise ValueError('at least one portable constraint bound is required') return selfBase 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 kind : Literal['package_count']var max_additions : int | Nonevar max_removals : int | Nonevar max_result_count : int | Nonevar model_config
Inherited members
class MediaBuyChangeTermConstraints4 (**data: Any)-
Expand source code
class MediaBuyChangeTermConstraints4(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) kind: Literal['effective_timing'] = 'effective_timing' minimum_notice: Annotated[ duration.Duration | None, Field( description='Minimum elapsed notice before pause, resume, cancellation, or another operational action may take effect.' ), ] = None earliest_effective_at: AwareDatetime | None = None latest_effective_at: AwareDatetime | None = None @model_validator(mode='after') def _require_portable_bound(self) -> MediaBuyChangeTermConstraints4: if not any(getattr(self, name) is not None for name in ('minimum_notice', 'earliest_effective_at', 'latest_effective_at')): raise ValueError('at least one portable constraint bound is required') return selfBase 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 earliest_effective_at : pydantic.types.AwareDatetime | Nonevar kind : Literal['effective_timing']var latest_effective_at : pydantic.types.AwareDatetime | Nonevar minimum_notice : Duration | Nonevar model_config
Inherited members
class Money (**data: Any)-
Expand source code
class Money(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) amount: Annotated[StrictFloat, Field(ge=0.0)] currency: Annotated[str, Field(pattern='^[A-Z]{3}$')]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 amount : floatvar currency : strvar model_config
Inherited members