Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

UX2.0 Fix default value in BFDParcel model. #643

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
from typing import List, Literal, Optional
from typing import List, Literal, Optional, Union

from pydantic import AliasPath, BaseModel, ConfigDict, Field

from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global
from catalystwan.api.configuration_groups.parcel import Default, Global, _ParcelBase, as_default, as_global
from catalystwan.models.common import TLOCColor


class Color(BaseModel):
color: Global[TLOCColor]
hello_interval: Optional[Global[int]] = Field(
default=as_global(1000), validation_alias="helloInterval", serialization_alias="helloInterval"
hello_interval: Optional[Union[Global[int], Default[int]]] = Field(
default=as_default(1000), validation_alias="helloInterval", serialization_alias="helloInterval"
)
multiplier: Optional[Global[int]] = as_global(7)
pmtu_discovery: Optional[Global[bool]] = Field(
default=as_global(True), validation_alias="pmtuDiscovery", serialization_alias="pmtuDiscovery"
multiplier: Optional[Union[Global[int], Default[int]]] = as_default(7)
pmtu_discovery: Optional[Union[Global[bool], Default[int]]] = Field(
default=as_default(True), validation_alias="pmtuDiscovery", serialization_alias="pmtuDiscovery"
)
dscp: Optional[Global[int]] = as_global(48)
dscp: Optional[Union[Global[int], Default[int]]] = as_default(48)
model_config = ConfigDict(populate_by_name=True)


class BFDParcel(_ParcelBase):
type_: Literal["bfd"] = Field(default="bfd", exclude=True)
model_config = ConfigDict(arbitrary_types_allowed=True, populate_by_name=True)

multiplier: Optional[Global[int]] = Field(default=as_global(6), validation_alias=AliasPath("data", "multiplier"))
poll_interval: Optional[Global[int]] = Field(
default=as_global(600000),
multiplier: Optional[Union[Global[int], Default[int]]] = Field(
default=as_default(6), validation_alias=AliasPath("data", "multiplier")
)
poll_interval: Optional[Union[Global[int], Default[int]]] = Field(
default=as_default(600000),
validation_alias=AliasPath("data", "pollInterval"),
description="Poll Interval (In Millisecond)",
)
default_dscp: Optional[Global[int]] = Field(
default=as_global(48),
default_dscp: Optional[Union[Global[int], Default[int]]] = Field(
default=as_default(48),
validation_alias=AliasPath("data", "defaultDscp"),
description="DSCP Values for BFD Packets (decimal)",
)
Expand Down