From d1d9d9818a1fa06c98590bfaedde456a3f5396a7 Mon Sep 17 00:00:00 2001 From: Jakub Krajewski Date: Thu, 12 Dec 2024 17:51:34 +0100 Subject: [PATCH] Add uc-voice models that were added in 20.14 --- .../configuration/feature_profile/parcel.py | 9 +- .../sdwan/uc_voice/__init__.py | 34 +- .../sdwan/uc_voice/analog_interface.py | 438 ++++++++++++++++++ .../sdwan/uc_voice/call_routing.py | 179 +++++++ .../sdwan/uc_voice/digital_interface.py | 239 ++++++++++ .../sdwan/uc_voice/server_group.py | 51 ++ .../feature_profile/sdwan/uc_voice/srst.py | 90 ++++ .../sdwan/uc_voice/supervisory_disconnect.py | 68 +++ .../sdwan/uc_voice/voice_global.py | 55 +++ .../sdwan/uc_voice/voice_tenant.py | 40 ++ 10 files changed, 1198 insertions(+), 5 deletions(-) create mode 100644 catalystwan/models/configuration/feature_profile/sdwan/uc_voice/analog_interface.py create mode 100644 catalystwan/models/configuration/feature_profile/sdwan/uc_voice/call_routing.py create mode 100644 catalystwan/models/configuration/feature_profile/sdwan/uc_voice/digital_interface.py create mode 100644 catalystwan/models/configuration/feature_profile/sdwan/uc_voice/server_group.py create mode 100644 catalystwan/models/configuration/feature_profile/sdwan/uc_voice/srst.py create mode 100644 catalystwan/models/configuration/feature_profile/sdwan/uc_voice/supervisory_disconnect.py create mode 100644 catalystwan/models/configuration/feature_profile/sdwan/uc_voice/voice_global.py create mode 100644 catalystwan/models/configuration/feature_profile/sdwan/uc_voice/voice_tenant.py diff --git a/catalystwan/models/configuration/feature_profile/parcel.py b/catalystwan/models/configuration/feature_profile/parcel.py index b1c0663b..1fc6a819 100644 --- a/catalystwan/models/configuration/feature_profile/parcel.py +++ b/catalystwan/models/configuration/feature_profile/parcel.py @@ -24,6 +24,7 @@ ParcelType = Literal[ "aaa", + "analog-interface", "app-list", "app-probe", "appqoe", @@ -32,6 +33,7 @@ "basic", "bfd", "bgp", + "call-routing", "cellular-controller", "cellular-profile", "cflowd", @@ -42,6 +44,7 @@ "data-ipv6-prefix", "data-prefix", "dhcp-server", + "digital-interface", "dns", "dsp-farm", "expanded-community", @@ -93,10 +96,13 @@ "security-urllist", "security-zone", "security", + "server-group", "sig", "sla-class", "snmp", "standard-community", + "strt", + "supervisory-disconnect", "switchport", "t1-e1-controller", "tloc", @@ -111,7 +117,8 @@ "unified/ssl-decryption-profile", "unified/ssl-decryption", "unified/url-filtering", - "wan/vpn", + "voice-global", + "voice-tenant" "wan/vpn", "wan/vpn/interface/cellular", "wan/vpn/interface/dsl-ipoe", "wan/vpn/interface/dsl-pppoa", diff --git a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/__init__.py b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/__init__.py index 82d04f45..7b8777f8 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/__init__.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/__init__.py @@ -5,25 +5,51 @@ from pydantic import Field from typing_extensions import Annotated +from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.analog_interface import AnalogInterfaceParcel +from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.call_routing import CallRoutingParcel +from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.digital_interface import DigitalInterfaceParcel +from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.dsp_farm import DspFarmParcel from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.media_profile import MediaProfileParcel +from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.server_group import ServerGroupParcel +from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.srst import SrstParcel from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.translation_profile import TranslationProfileParcel from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.translation_rule import TranslationRuleParcel from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.trunk_group import TrunkGroupParcel - -from .dsp_farm import DspFarmParcel +from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.voice_global import VoiceGlobalParcel +from catalystwan.models.configuration.feature_profile.sdwan.uc_voice.voice_tenant import VoiceTenantParcel AnyUcVoiceParcel = Annotated[ - Union[DspFarmParcel, MediaProfileParcel, TrunkGroupParcel, TranslationRuleParcel, TranslationProfileParcel], + Union[ + AnalogInterfaceParcel, + CallRoutingParcel, + DigitalInterfaceParcel, + DspFarmParcel, + MediaProfileParcel, + ServerGroupParcel, + SrstParcel, + TranslationProfileParcel, + TranslationRuleParcel, + TrunkGroupParcel, + VoiceGlobalParcel, + VoiceTenantParcel, + ], Field(discriminator="type_"), ] __all__ = ( + "AnalogInterfaceParcel", "AnyUcVoiceParcel", + "CallRoutingParcel", + "DigitalInterfaceParcel", "DspFarmParcel", "MediaProfileParcel", - "TrunkGroupParcel", + "ServerGroupParcel", + "SrstParcel", "TranslationProfileParcel", "TranslationRuleParcel", + "TrunkGroupParcel", + "VoiceGlobalParcel", + "VoiceTenantParcel", ) diff --git a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/analog_interface.py b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/analog_interface.py new file mode 100644 index 00000000..2789ae20 --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/analog_interface.py @@ -0,0 +1,438 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +from typing import List, Literal, Optional, Union + +from pydantic import AliasPath, BaseModel, ConfigDict, Field + +from catalystwan.api.configuration_groups.parcel import Default, Global, Variable, _ParcelBase +from catalystwan.models.configuration.feature_profile.common import RefIdItem + +SlotId = Literal[ + "0/1", + "0/2", + "0/3", + "1/0", + "1/1", + "2/0", + "2/1", + "3/0", +] + +ModuleType = Literal[ + "12 Port FXO", + "16 Port FXS", + "2 Port FXO", + "2 Port FXS", + "24 Port FXS", + "4 Port FXO", + "4 Port FXS", + "72 Port FXS", + "8 Port FXS", +] + +SignalChoice = Literal[ + "DID", + "GroundStart", + "LoopStart", +] + + +DidType = Literal[ + "Delay dial", + "Immediate", + "Wink start", +] + + +class VoiceCardBasic(BaseModel): + model_config = ConfigDict(populate_by_name=True) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + shutdown: Union[Variable, Default[bool], Global[bool]] = Field() + signal_choice: Union[Variable, Global[SignalChoice], Default[Literal["loopStart"]]] = Field( + validation_alias="signalChoice", serialization_alias="signalChoice" + ) + description: Optional[Union[Variable, Default[None], Global[str]]] = Field(default=None) + did_type: Optional[Union[Variable, Default[None], Global[DidType]]] = Field( + default=None, validation_alias="didType", serialization_alias="didType" + ) + + +class VoiceCardStationID(BaseModel): + model_config = ConfigDict(populate_by_name=True) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + station_name: Union[Variable, Global[str]] = Field( + validation_alias="stationName", serialization_alias="stationName" + ) + station_number: Union[Variable, Global[str]] = Field( + validation_alias="stationNumber", serialization_alias="stationNumber" + ) + + +CompandType = Literal[ + "A-law", + "U-law", +] + + +Impedance = Literal[ + "600c", + "600r", + "900c", + "900r", + "complex1", + "complex2", + "complex3", + "complex4", + "complex5", + "complex6", +] + + +CallProgressTone = Literal[ + "Argentina", + "Australia", + "Austria", + "Belgium", + "Brazil", + "Canada", + "Chile", + "China", + "Columbia", + "Custom 1", + "Custom 2", + "Cyprus", + "Czech Republic", + "Denmark", + "Egypt", + "Finland", + "France", + "Germany", + "Ghana", + "Greece", + "Hong Kong", + "Hungary", + "Iceland", + "India", + "Indonesia", + "Ireland", + "Israel", + "Italy", + "Japan", + "Jordan", + "Kenya", + "Korea Republic", + "Kuwait", + "Lebanon", + "Luxembourg", + "Malaysia", + "Malta", + "Mexico", + "Nepal", + "Netherlands", + "New Zealand", + "Nigeria", + "Norway", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Poland", + "Portugal", + "Russian Federation", + "Saudi Arabia", + "Singapore", + "Slovakia", + "Slovenia", + "South Africa", + "Spain", + "Sweden", + "Switzerland", + "Taiwan", + "Thailand", + "Turkey", + "United Arab Emirates", + "United Kingdom", + "United States", + "Venezuela", + "Zimbabwe", +] + + +class LineParams(BaseModel): + model_config = ConfigDict(populate_by_name=True) + attenuation: Union[Variable, Default[int], Global[int]] = Field() + call_progress_tone: Union[Variable, Global[CallProgressTone]] = Field( + validation_alias="callProgressTone", serialization_alias="callProgressTone" + ) + compand_type: Union[Variable, Global[CompandType], Default[Literal["U-law"]]] = Field( + validation_alias="compandType", serialization_alias="compandType" + ) + echo_canceller: Union[Variable, Default[bool], Global[bool]] = Field( + validation_alias="echoCanceller", serialization_alias="echoCanceller" + ) + gain: Union[Variable, Default[int], Global[int]] = Field() + impedance: Union[Global[Impedance], Default[Literal["600r"]], Variable] = Field() + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + voice_activity_detection: Union[Variable, Default[bool], Global[bool]] = Field( + validation_alias="voiceActivityDetection", serialization_alias="voiceActivityDetection" + ) + + +SupervisoryDisconnect = Literal[ + "Anytone", + "Dualtone", + "signal", +] + + +SupervisoryDisconnectDualtone = Literal[ + "Mid call", + "Pre Connect", +] + +DialType = Literal[ + "dtmf", + "mf", + "pulse", +] + + +DetectionDelayBatteryReversal = Literal[ + "Answer", + "Both", + "Detection Delay", +] + + +class TuningParams(BaseModel): + model_config = ConfigDict(populate_by_name=True) + detection_delay: Union[Variable, Global[int]] = Field( + validation_alias="detectionDelay", serialization_alias="detectionDelay" + ) + detection_delay_battery_reversal: Union[Variable, Global[DetectionDelayBatteryReversal]] = Field( + validation_alias="detectionDelayBatteryReversal", serialization_alias="detectionDelayBatteryReversal" + ) + dial_delay: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="dialDelay", serialization_alias="dialDelay" + ) + dial_type: Union[Global[DialType], Variable, Default[Literal["dtmf"]]] = Field( + validation_alias="dialType", serialization_alias="dialType" + ) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + supervisory_disconnect: Union[Global[SupervisoryDisconnect], Default[Literal["signal"]], Variable] = Field( + validation_alias="supervisoryDisconnect", serialization_alias="supervisoryDisconnect" + ) + timing_guard_out: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="timingGuardOut", serialization_alias="timingGuardOut" + ) + timing_hookflash_out: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="timingHookflashOut", serialization_alias="timingHookflashOut" + ) + timing_sup_disconnect: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="timingSupDisconnect", serialization_alias="timingSupDisconnect" + ) + supervisory_disconnect_dualtone: Optional[Union[Variable, Global[SupervisoryDisconnectDualtone]]] = Field( + default=None, + validation_alias="supervisoryDisconnectDualtone", + serialization_alias="supervisoryDisconnectDualtone", + ) + + +LoopLength = Literal[ + "Long", + "Short", +] + + +DcOffSet = Literal[ + "10-volts", + "20-volts", + "24-volts", + "30-volts", + "35-volts", +] + + +class TuningParamsFxs(BaseModel): + model_config = ConfigDict(populate_by_name=True) + loop_length: Union[Variable, Global[LoopLength], Default[Literal["Short"]]] = Field( + validation_alias="loopLength", serialization_alias="loopLength" + ) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + pulse_digit_detection: Union[Variable, Default[bool], Global[bool]] = Field( + validation_alias="pulseDigitDetection", serialization_alias="pulseDigitDetection" + ) + ren: Union[Variable, Global[int]] = Field() + ring: Union[Variable, Default[int], Global[int]] = Field() + timing_hookflash_in: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="timingHookflashIn", serialization_alias="timingHookflashIn" + ) + dc_off_set: Optional[Union[Variable, Global[DcOffSet]]] = Field( + default=None, validation_alias="dcOffSet", serialization_alias="dcOffSet" + ) + timing_hookflash_out_sup: Optional[Union[Variable, Default[int], Global[int]]] = Field( + default=None, validation_alias="timingHookflashOutSup", serialization_alias="timingHookflashOutSup" + ) + + +CallerMode = Literal[ + "BT", + "DTMF", + "FSK", +] + +DtmfModeSelectionEnd = Literal[ + "#", + "*", + "A", + "B", + "C", + "D", +] + +AlertOptions = Literal[ + "Line-Reversal", + "Pre-ring", + "Ring 1", + "Ring 2", + "Ring 3", + "Ring 4", +] + + +class CallerId(BaseModel): + model_config = ConfigDict(populate_by_name=True) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + alert_options: Optional[Union[Global[AlertOptions], Variable, Default[None]]] = Field( + default=None, validation_alias="alertOptions", serialization_alias="alertOptions" + ) + caller_dsp_pre_allocate: Optional[Union[Variable, Default[bool], Global[bool]]] = Field( + default=None, validation_alias="callerDspPreAllocate", serialization_alias="callerDspPreAllocate" + ) + caller_id_block: Optional[Union[Variable, Default[bool], Global[bool]]] = Field( + default=None, validation_alias="callerIdBlock", serialization_alias="callerIdBlock" + ) + caller_id_format: Optional[Union[Variable, Default[bool], Global[bool]]] = Field( + default=None, validation_alias="callerIdFormat", serialization_alias="callerIdFormat" + ) + caller_mode: Optional[Union[Variable, Global[CallerMode], Default[None]]] = Field( + default=None, validation_alias="callerMode", serialization_alias="callerMode" + ) + dtmf_codes: Optional[Union[Variable, Global[str]]] = Field( + default=None, validation_alias="dtmfCodes", serialization_alias="dtmfCodes" + ) + dtmf_mode_selection_end: Optional[Union[Variable, Global[DtmfModeSelectionEnd], Default[None]]] = Field( + default=None, validation_alias="dtmfModeSelectionEnd", serialization_alias="dtmfModeSelectionEnd" + ) + dtmf_mode_selection_start: Optional[Union[Variable, Global[DtmfModeSelectionEnd], Default[None]]] = Field( + default=None, validation_alias="dtmfModeSelectionStart", serialization_alias="dtmfModeSelectionStart" + ) + enable: Optional[Union[Variable, Default[bool], Global[bool]]] = Field(default=None) + + +class DidTimer(BaseModel): + model_config = ConfigDict(populate_by_name=True) + answer_winkwidth: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="answerWinkwidth", serialization_alias="answerWinkwidth" + ) + clear_wait: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="clearWait", serialization_alias="clearWait" + ) + dial_pulse_min_delay: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="dialPulseMinDelay", serialization_alias="dialPulseMinDelay" + ) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + wait_before_wink: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="waitBeforeWink", serialization_alias="waitBeforeWink" + ) + wink_duration: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="winkDuration", serialization_alias="winkDuration" + ) + + +class ConnectionPlar(BaseModel): + model_config = ConfigDict(populate_by_name=True) + connection_plar: Union[Variable, Global[str]] = Field( + validation_alias="connectionPlar", serialization_alias="connectionPlar" + ) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + connection_plar_opx: Optional[Union[Variable, Default[bool], Global[bool]]] = Field( + default=None, validation_alias="connectionPlarOpx", serialization_alias="connectionPlarOpx" + ) + + +TranslationRuleDirection = Literal[ + "incoming", + "outgoing", +] + + +class Association(BaseModel): + model_config = ConfigDict(populate_by_name=True) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + supervisory_disconnect: Optional[RefIdItem] = Field( + default=None, validation_alias="supervisoryDisconnect", serialization_alias="supervisoryDisconnect" + ) + translation_profile: Optional[RefIdItem] = Field( + default=None, validation_alias="translationProfile", serialization_alias="translationProfile" + ) + translation_rule_direction: Optional[Union[Variable, Global[TranslationRuleDirection], Default[None]]] = Field( + default=None, validation_alias="translationRuleDirection", serialization_alias="translationRuleDirection" + ) + trunk_group: Optional[RefIdItem] = Field( + default=None, validation_alias="trunkGroup", serialization_alias="trunkGroup" + ) + trunk_group_priority: Optional[Union[Variable, Global[int], Default[None]]] = Field( + default=None, validation_alias="trunkGroupPriority", serialization_alias="trunkGroupPriority" + ) + + +class AnalogInterfaceParcel(_ParcelBase): + type_: Literal["analog-interface"] = Field(default="analog-interface", exclude=True) + model_config = ConfigDict(populate_by_name=True) + enable: Union[Variable, Default[bool], Global[bool]] = Field(validation_alias=AliasPath("data", "enable")) + slot_id: Union[Variable, Global[SlotId]] = Field(validation_alias=AliasPath("data", "slotId")) + association: Optional[List[Association]] = Field( + default=None, + validation_alias=AliasPath("data", "association"), + description="Association", + ) + caller_id: Optional[List[CallerId]] = Field(default=None, validation_alias=AliasPath("data", "callerId")) + connection_plar: Optional[List[ConnectionPlar]] = Field( + default=None, + validation_alias=AliasPath("data", "connectionPlar"), + description="Connection plar", + ) + did_timer: Optional[List[DidTimer]] = Field( + default=None, + validation_alias=AliasPath("data", "didTimer"), + description="DID timer", + ) + line_params: Optional[List[LineParams]] = Field( + default=None, + validation_alias=AliasPath("data", "lineParams"), + description="Configure of voice card station Id", + ) + module_type: Optional[Global[ModuleType]] = Field( + default=None, validation_alias="moduleType", serialization_alias="moduleType" + ) + tuning_params: Optional[List[TuningParams]] = Field( + default=None, + validation_alias=AliasPath("data", "tuningParams"), + description="Configure of voice card station Id", + ) + tuning_params_fxs: Optional[List[TuningParamsFxs]] = Field( + default=None, + validation_alias=AliasPath("data", "tuningParamsFxs"), + description="Configure of voice card station Id", + ) + voice_card_basic: Optional[List[VoiceCardBasic]] = Field( + default=None, + validation_alias=AliasPath("data", "voiceCardBasic"), + description="Configure of voice card", + ) + voice_card_station_i_d: Optional[List[VoiceCardStationID]] = Field( + default=None, + validation_alias=AliasPath("data", "voiceCardStationID"), + description="Configure of voice card station Id", + ) diff --git a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/call_routing.py b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/call_routing.py new file mode 100644 index 00000000..a483ab5f --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/call_routing.py @@ -0,0 +1,179 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +from typing import List, Literal, Optional, Union + +from pydantic import AliasPath, BaseModel, ConfigDict, Field + +from catalystwan.api.configuration_groups.parcel import Default, Global, Variable, _ParcelBase +from catalystwan.models.configuration.feature_profile.common import RefIdItem + +VoiceType = Literal[ + "pots", + "sip", +] + +TranslationRuleDirection = Literal[ + "incoming", + "outgoing", +] + +FwdDigitChoice = Literal[ + "all", + "none", + "some", +] + +TransportChoice = Literal[ + "tcp", + "udp", +] + + +class Voice(BaseModel): + model_config = ConfigDict(populate_by_name=True) + dialpeertag: Union[Variable, Global[int]] = Field() + call_type: Optional[Global[TranslationRuleDirection]] = Field( + default=None, validation_alias="callType", serialization_alias="callType" + ) + description: Optional[Union[Variable, Default[None], Global[str]]] = Field( + default=None, + validation_alias=AliasPath("data", "description"), + ) + destination_address: Optional[Union[Variable, Global[str]]] = Field( + default=None, validation_alias="destinationAddress", serialization_alias="destinationAddress" + ) + fwd_digit_choice: Optional[Union[Variable, Global[FwdDigitChoice]]] = Field( + default=None, validation_alias="fwdDigitChoice", serialization_alias="fwdDigitChoice" + ) + num_digits: Optional[Union[Variable, Global[int]]] = Field( + default=None, validation_alias="numDigits", serialization_alias="numDigits" + ) + number_pattern: Optional[Union[Variable, Global[str]]] = Field( + default=None, validation_alias="numberPattern", serialization_alias="numberPattern" + ) + port: Optional[Union[Variable, Global[str]]] = Field(default=None) + preference: Optional[Union[Variable, Global[int], Default[None]]] = Field(default=None) + prefix: Optional[Union[Variable, Global[int], Default[None]]] = Field(default=None) + transport_choice: Optional[Union[Variable, Global[TransportChoice], Default[None]]] = Field( + default=None, validation_alias="transportChoice", serialization_alias="transportChoice" + ) + type: Optional[Global[VoiceType]] = Field(default=None) + + +Fallback = Literal[ + "G.711alaw", + "G.711ulaw", + "None", +] + + +class ModemPassThrough(BaseModel): + model_config = ConfigDict(populate_by_name=True) + dial_peer_range: Union[Variable, Global[str]] = Field( + validation_alias="dialPeerRange", serialization_alias="dialPeerRange" + ) + protocol: Union[Variable, Global[Fallback]] = Field() + + +Primary = Literal[ + "Fax Pass-through G711alaw", + "Fax Pass-through G711alaw No ECM", + "Fax Pass-through G711ulaw", + "Fax Pass-through G711ulaw No ECM", + "None", + "T.38 Fax Relay Version 0", + "T.38 Fax Relay Version 0 NSE", + "T.38 Fax Relay Version 0 NSE No ECM", + "T.38 Fax Relay Version 0 NSE Rate 14.4", + "T.38 Fax Relay Version 0 NSE Rate 14.4 No ECM", + "T.38 Fax Relay Version 0 NSE Rate 9.6", + "T.38 Fax Relay Version 0 NSE Rate 9.6 No ECM", + "T.38 Fax Relay Version 0 NSE force", + "T.38 Fax Relay Version 0 NSE force No ECM", + "T.38 Fax Relay Version 0 NSE force Rate 14.4", + "T.38 Fax Relay Version 0 NSE force Rate 14.4 No ECM", + "T.38 Fax Relay Version 0 NSE force Rate 9.6", + "T.38 Fax Relay Version 0 NSE force Rate 9.6 No ECM", + "T.38 Fax Relay Version 0 No ECM", + "T.38 Fax Relay Version 0 Rate 14.4", + "T.38 Fax Relay Version 0 Rate 14.4 No ECM", + "T.38 Fax Relay Version 0 Rate 9.6 No ECM", + "T.38 Fax Relay Version 3", + "T.38 Fax Relay Version 3 NSE", + "T.38 Fax Relay Version 3 NSE force", +] + + +class FaxProtocol(BaseModel): + model_config = ConfigDict(populate_by_name=True) + dial_peer_range: Union[Variable, Global[str]] = Field( + validation_alias="dialPeerRange", serialization_alias="dialPeerRange" + ) + primary: Union[Variable, Global[Primary]] = Field() + fallback: Optional[Union[Variable, Global[Fallback]]] = Field(default=None) + high_speed: Optional[Union[Variable, Global[int]]] = Field( + default=None, validation_alias="highSpeed", serialization_alias="highSpeed" + ) + low_speed: Optional[Union[Variable, Global[int]]] = Field( + default=None, validation_alias="lowSpeed", serialization_alias="lowSpeed" + ) + + +class Association(BaseModel): + model_config = ConfigDict(populate_by_name=True) + dial_peer_range: Union[Variable, Global[str]] = Field( + validation_alias="dialPeerRange", serialization_alias="dialPeerRange" + ) + media_profile: Optional[RefIdItem] = Field( + default=None, validation_alias="mediaProfile", serialization_alias="mediaProfile" + ) + server_group: Optional[RefIdItem] = Field( + default=None, validation_alias="serverGroup", serialization_alias="serverGroup" + ) + translation_profile: Optional[RefIdItem] = Field( + default=None, validation_alias="translationProfile", serialization_alias="translationProfile" + ) + translation_rule_direction: Optional[Union[Variable, Global[TranslationRuleDirection], Default[None]]] = Field( + default=None, validation_alias="translationRuleDirection", serialization_alias="translationRuleDirection" + ) + trunk_group: Optional[RefIdItem] = Field( + default=None, validation_alias="trunkGroup", serialization_alias="trunkGroup" + ) + trunk_group_priority: Optional[Union[Variable, Global[int], Default[None]]] = Field( + default=None, validation_alias="trunkGroupPriority", serialization_alias="trunkGroupPriority" + ) + voice_tenant: Optional[RefIdItem] = Field( + default=None, validation_alias="voiceTenant", serialization_alias="voiceTenant" + ) + + +class CallRoutingParcel(_ParcelBase): + type_: Literal["call-routing"] = Field(default="call-routing", exclude=True) + model_config = ConfigDict(populate_by_name=True) + association: Optional[List[Association]] = Field( + default=None, + validation_alias=AliasPath("data", "association"), + description="Association", + ) + dial_peer_tag_prefix: Optional[Union[Variable, Global[int], Default[None]]] = Field( + default=None, + validation_alias=AliasPath("data", "dialPeerTagPrefix"), + ) + fax_protocol: Optional[List[FaxProtocol]] = Field( + default=None, + validation_alias=AliasPath("data", "faxProtocol"), + description="Configure fax protocol", + ) + modem_pass_through: Optional[List[ModemPassThrough]] = Field( + default=None, + validation_alias=AliasPath("data", "modemPassThrough"), + description="Configure of Modem Pass-Through", + ) + port_module_location: Optional[RefIdItem] = Field( + default=None, + validation_alias=AliasPath("data", "portModuleLocation"), + ) + voice: Optional[List[Voice]] = Field( + default=None, + validation_alias=AliasPath("data", "voice"), + description="POTS/Voip voice type", + ) diff --git a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/digital_interface.py b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/digital_interface.py new file mode 100644 index 00000000..f1e6aea1 --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/digital_interface.py @@ -0,0 +1,239 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +from typing import List, Literal, Optional, Union +from uuid import UUID + +from pydantic import AliasPath, BaseModel, ConfigDict, Field + +from catalystwan.api.configuration_groups.parcel import Global, Variable, _ParcelBase, Default +from catalystwan.models.configuration.feature_profile.common import RefIdItem + +VoiceInterfaceTemplates = Literal[ + "1 Port E1", + "1 Port T1", + "2 Port E1", + "2 Port T1", + "4 Port E1", + "4 Port T1", + "8 Port E1", + "8 Port T1", +] + +ModuleLocation = Literal[ + "0/1", + "0/2", + "0/3", + "1/0", + "2/0", +] + +ClockType = Literal[ + "line", + "network", + "primary", + "secondary", +] + +class Interface(BaseModel): + port_id: Union[Variable, Global[int], Default[None]] = Field(validation_alias="portId", serialization_alias="portId") + clock_type: Optional[Union[Variable, Default[None], Global[ClockType]]] = Field(default=None, validation_alias="clockType", serialization_alias="clockType") + + +Framing = Literal[ + "crc4", + "no-crc4", + "crc4", + "esf", + "sf", +] + + +LineCode = Literal[ + "ami", + "b8zs", + "hdb3", +] + + +CableLengthType = Literal[ + "long", + "short", +] + + +Value = Literal[ + "-15", + "-22.5", + "-7.5", + "0", +] + +CableLengthValue = Literal[ + "110", + "220", + "330", + "440", + "550", + "660", +] + + +LineTermination = Literal[ + "120-ohm", + "75-ohm", +] + + +SwitchType = Literal[ + "primary-4ess", + "primary-5ess", + "primary-dms100", + "primary-net5", + "primary-ni", + "primary-ntt", + "primary-qsig", +] + +class BasicSettings(BaseModel): + model_config = ConfigDict(populate_by_name=True) + delay_connect_timer: Union[Variable, Default[int], Global[int]] = Field(validation_alias="delayConnectTimer", serialization_alias="delayConnectTimer") + framing: Union[Variable, Global[Framing], Default[Framing]] = Field() + line_code: Union[Variable, Default[LineCode], Global[LineCode]] = Field(validation_alias="lineCode", serialization_alias="lineCode") + network_side: Union[Variable, Default[bool], Global[bool]] = Field(validation_alias="networkSide", serialization_alias="networkSide") + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + switch_type: Union[Variable, Global[SwitchType], Default[SwitchType]] = Field(validation_alias="switchType", serialization_alias="switchType") + cable_length: Optional[Union[Variable, Default[Literal["0"]], Global[CableLengthValue]]] = Field(default=None, validation_alias="cableLength", serialization_alias="cableLength") + cable_length_type: Optional[Union[Variable, Default[Literal["long"]], Global[CableLengthType]]] = Field(default=None, validation_alias="cableLengthType", serialization_alias="cableLengthType") + framing_australia: Optional[Union[Variable, Default[bool], Global[bool]]] = Field(default=None, validation_alias="framingAustralia", serialization_alias="framingAustralia") + line_termination: Optional[Union[Variable, Default[Literal["120-ohm"]], Global[LineTermination]]] = Field(default=None, validation_alias="lineTermination", serialization_alias="lineTermination") + timeslots: Optional[Global[str]] = Field(default=None) + +TypeAndTimerType = Literal[ + "T200", + "T203", + "T301", + "T303", + "T306", + "T309", + "T310", + "T321", +] + +class TypeAndTimer(BaseModel): + model_config = ConfigDict(populate_by_name=True) + timer: Union[Variable, Global[int]] = Field() + type: Union[Variable, Global[TypeAndTimerType]] = Field() + +class IsdnTimer(BaseModel): + model_config = ConfigDict(populate_by_name=True) + port_range: Optional[Union[Variable, Global[str]]] = Field(default=None, validation_alias="portRange", serialization_alias="portRange") + type_and_timer: Optional[List[TypeAndTimer]] = Field(default=None, validation_alias="typeAndTimer", serialization_alias="typeAndTimer", description="list of ISDN Type and Timers") + +Plan = Literal[ + "data", + "isdn", + "national", + "privacy", + "reserved/10", + "reserved/11", + "reserved/12", + "reserved/13", + "reserved/14", + "reserved/2", + "reserved/5", + "reserved/6", + "reserved/7", + "telex", + "unknown", +] + +IsdnMapType = Literal[ + "abbreviated", + "international", + "national", + "reserved/5", + "subscriber", + "unknown", +] + +class IsdnMap(BaseModel): + model_config = ConfigDict(populate_by_name=True) + digit_range: Union[Variable, Global[str]] = Field(validation_alias="digitRange", serialization_alias="digitRange") + plan: Union[Variable, Default[None], Global[Plan]] = Field() + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + type: Union[Variable, Default[None], Global[IsdnMapType]] = Field() + +class Shutdown(BaseModel): + model_config = ConfigDict(populate_by_name=True) + controller: Union[Variable, Default[bool], Global[bool]] = Field() + port_id: Union[Variable, Global[int], Default[None]] = Field(validation_alias="portId", serialization_alias="portId") + serial: Union[Variable, Default[bool], Global[bool]] = Field() + voice_port: Union[Variable, Default[bool], Global[bool]] = Field(validation_alias="voicePort", serialization_alias="voicePort") + +CompandType = Literal[ + "a-law", + "u-law", +] + +class LineParams(BaseModel): + model_config = ConfigDict(populate_by_name=True) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + attenuation: Optional[Union[Variable, Default[int], Global[int]]] = Field(default=None) + call_progress_tone: Optional[Union[Variable, Global[None], Default[None]]] = Field(default=None, validation_alias="callProgressTone", serialization_alias="callProgressTone") + compand_type: Optional[Union[Variable, Default[CompandType], Global[CompandType]]] = Field(default=None, validation_alias="compandType", serialization_alias="compandType") + echo_canceller: Optional[Union[Variable, Default[bool], Global[bool]]] = Field(default=None, validation_alias="echoCanceller", serialization_alias="echoCanceller") + gain: Optional[Union[Variable, Default[int], Global[int]]] = Field(default=None) + voice_activity_detection: Optional[Union[Variable, Default[bool], Global[bool]]] = Field(default=None, validation_alias="voiceActivityDetection", serialization_alias="voiceActivityDetection") + +OutgoingIeType = Literal[ + "called-number", + "called-subaddr", + "caller-number", + "caller-subaddr", + "connected-number", + "connected-subaddr", + "display", + "extended-facility", + "facility", + "high-layer-compat", + "low-layer-compat", + "network-facility", + "notify-indicator", + "progress-indicator", + "redirecting-number", + "user-user", +] + +class OutgoingIe(BaseModel): + model_config = ConfigDict(populate_by_name=True) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + type: Union[Variable, Global[List[OutgoingIeType]]] = Field() + + +TranslationProfileDirection = Literal[ + "incoming", + "outgoing", +] + + +class Associations(BaseModel): + model_config = ConfigDict(populate_by_name=True) + port_range: Union[Variable, Global[str]] = Field(validation_alias="portRange", serialization_alias="portRange") + translation_profile: Optional[RefIdItem] = Field(default=None, validation_alias="translationProfile", serialization_alias="translationProfile") + translation_profile_direction: Optional[Union[Variable, Default[None], Global[TranslationProfileDirection]]] = Field(default=None, validation_alias="translationProfileDirection", serialization_alias="translationProfileDirection") + trunk_group: Optional[RefIdItem] = Field(default=None, validation_alias="trunkGroup", serialization_alias="trunkGroup") + trunk_group_priority: Optional[Union[Variable, Global[int], Default[None]]] = Field(default=None, validation_alias="trunkGroupPriority", serialization_alias="trunkGroupPriority") + +class DigitalInterfaceParcel(_ParcelBase): + type_: Literal["digital-interface"] = Field(default="digital-interface", exclude=True) + model_config = ConfigDict(populate_by_name=True) + basic_settings: List[BasicSettings] = Field(validation_alias=AliasPath("data", "basicSettings"), description="add basic setting") + dsp_hairpin: Union[Variable, Default[bool], Global[bool]] = Field(validation_alias=AliasPath("data", "dspHairpin"), ) + interface: List[Interface] = Field(validation_alias=AliasPath("data", "interface"), description="Configure Digital voice card interface") + isdn_timer: List[IsdnTimer] = Field(validation_alias=AliasPath("data", "isdnTimer"), description="list of ISDN Timers") + module_location: Union[Variable, Global[ModuleLocation]] = Field(validation_alias=AliasPath("data", "moduleLocation")) + shutdown: List[Shutdown] = Field(validation_alias=AliasPath("data", "shutdown"), description="list of shutdown options") + associations: Optional[List[Associations]] = Field(default=None, validation_alias=AliasPath("data", "associations"), description="Select Trunk Group and Translation Profile associations") + isdn_map: Optional[List[IsdnMap]] = Field(default=None, validation_alias=AliasPath("data", "isdnMap"), description="list of ISDN map") + line_params: Optional[List[LineParams]] = Field(default=None, validation_alias=AliasPath("data", "lineParams"), description="list of line parameters") + outgoing_ie: Optional[List[OutgoingIe]] = Field(default=None, validation_alias=AliasPath("data", "outgoingIe"), description="list of outgoing IEs and messages") + voice_interface_templates: Optional[Global[VoiceInterfaceTemplates]] = Field(default=None, validation_alias="voiceInterfaceTemplates") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/server_group.py b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/server_group.py new file mode 100644 index 00000000..b867aa8e --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/server_group.py @@ -0,0 +1,51 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +from typing import List, Literal, Optional, Union + +from pydantic import AliasPath, BaseModel, ConfigDict, Field + +from catalystwan.api.configuration_groups.parcel import Default, Global, Variable, _ParcelBase + + +class AddressList(BaseModel): + model_config = ConfigDict(populate_by_name=True) + address: Union[Variable, Global[str]] = Field() + port: Optional[Union[Variable, Global[int], Default[None]]] = Field(default=None) + preference: Optional[Union[Variable, Global[int], Default[None]]] = Field(default=None) + + +HuntScheme = Literal[ + "none", + "round-robin", +] + + +class HuntStopRule(BaseModel): + model_config = ConfigDict(populate_by_name=True) + response_code_end: Union[Variable, Global[int]] = Field( + validation_alias="responseCodeEnd", serialization_alias="responseCodeEnd" + ) + response_code_start: Union[Variable, Global[int]] = Field( + validation_alias="responseCodeStart", serialization_alias="responseCodeStart" + ) + rule_id: Union[Variable, Global[int]] = Field(validation_alias="ruleId", serialization_alias="ruleId") + + +class ServerGroupParcel(_ParcelBase): + type_: Literal["server-group"] = Field(default="server-group", exclude=True) + model_config = ConfigDict(populate_by_name=True) + server_group_id: Union[Variable, Global[int]] = Field(validation_alias=AliasPath("data", "serverGroupId")) + address_list: Optional[List[AddressList]] = Field( + default=None, + validation_alias=AliasPath("data", "addressList"), + ) + hunt_scheme: Optional[Union[Variable, Global[HuntScheme], Default[Literal["none"]]]] = Field( + default=None, + validation_alias=AliasPath("data", "huntScheme"), + ) + hunt_stop_rule: Optional[List[HuntStopRule]] = Field( + default=None, + validation_alias=AliasPath("data", "huntStopRule"), + ) + shutdown: Optional[Union[Variable, Default[bool], Global[bool]]] = Field( + default=None, validation_alias=AliasPath("data", "shutdown") + ) diff --git a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/srst.py b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/srst.py new file mode 100644 index 00000000..38205bb0 --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/srst.py @@ -0,0 +1,90 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +from typing import List, Literal, Optional, Union + +from pydantic import AliasPath, BaseModel, ConfigDict, Field + +from catalystwan.api.configuration_groups.parcel import Default, Global, Variable, _ParcelBase +from catalystwan.models.configuration.feature_profile.common import RefIdItem + + +class Pool(BaseModel): + model_config = ConfigDict(populate_by_name=True) + ipv4_oripv6prefix: Union[Variable, Global[str]] = Field( + validation_alias="ipv4Oripv6prefix", serialization_alias="ipv4Oripv6prefix" + ) + pool_tag: Union[Variable, Global[int]] = Field(validation_alias="poolTag", serialization_alias="poolTag") + + +CallFowardAction = Literal[ + "all", + "busy", + "noan", +] + + +class CallForward(BaseModel): + action: Union[Variable, Global[CallFowardAction]] = Field() + digit_string: Union[Variable, Global[str]] = Field( + validation_alias="digitString", serialization_alias="digitString" + ) + phone_profile: Union[Variable, Global[int]] = Field( + validation_alias="phoneProfile", serialization_alias="phoneProfile" + ) + timeout: Optional[Union[Variable, Default[int], Global[int]]] = Field(default=None) + + +class TranslationProfile(BaseModel): + ref_id: Union[Default[None], Global[str]] = Field(validation_alias="refId", serialization_alias="refId") + + +TranslationProfileDirection = Literal[ + "incoming", + "outgoing", +] + + +class TranslationAndMediaProfile(BaseModel): + model_config = ConfigDict(populate_by_name=True) + media_profile: Optional[RefIdItem] = Field( + default=None, validation_alias="mediaProfile", serialization_alias="mediaProfile" + ) + phone_profile: Optional[Union[Variable, Global[int]]] = Field( + default=None, validation_alias="phoneProfile", serialization_alias="phoneProfile" + ) + translation_profile: Optional[TranslationProfile] = Field( + default=None, validation_alias="translationProfile", serialization_alias="translationProfile" + ) + translation_profile_direction: Optional[ + Union[Variable, Default[None], Global[TranslationProfileDirection]] + ] = Field( + default=None, validation_alias="translationProfileDirection", serialization_alias="translationProfileDirection" + ) + + +class SrstParcel(_ParcelBase): + type_: Literal["srst"] = Field(default="srst", exclude=True) + model_config = ConfigDict(populate_by_name=True) + max_dn: Union[Variable, Global[int]] = Field(validation_alias=AliasPath("data", "maxDn")) + max_phones: Union[Variable, Global[int]] = Field(validation_alias=AliasPath("data", "maxPhones")) + pool: List[Pool] = Field( + validation_alias=AliasPath("data", "pool"), + description="Voice register pool", + ) + call_forward: Optional[List[CallForward]] = Field( + default=None, + validation_alias=AliasPath("data", "callForward"), + description="Call forward option", + ) + filename: Optional[Union[Default[None], Global[str]]] = Field( + default=None, validation_alias=AliasPath("data", "filename") + ) + moh: Optional[Union[Default[bool], Global[bool]]] = Field(default=None, validation_alias=AliasPath("data", "moh")) + system_message: Optional[Union[Default[None], Global[str]]] = Field( + default=None, + validation_alias=AliasPath("data", "systemMessage"), + ) + translation_and_media_profile: Optional[List[TranslationAndMediaProfile]] = Field( + default=None, + validation_alias=AliasPath("data", "translationAndMediaProfile"), + description="translationProfile ID Refs and mediaProfile ID Refs", + ) diff --git a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/supervisory_disconnect.py b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/supervisory_disconnect.py new file mode 100644 index 00000000..2e0f3391 --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/supervisory_disconnect.py @@ -0,0 +1,68 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +from typing import List, Literal, Optional, Union + +from pydantic import AliasPath, BaseModel, ConfigDict, Field + +from catalystwan.api.configuration_groups.parcel import Default, Global, Variable, _ParcelBase + +DualTone = Literal[ + "Busy", + "Disconnect", + "Number Unobtainable", + "Out of Service", + "Reorder", + "Ringback", +] + + +class SupervisoryCustomCPTone(BaseModel): + model_config = ConfigDict(populate_by_name=True) + cadence: Union[Variable, Global[str]] = Field() + dual_tone: Union[Variable, Global[DualTone]] = Field(validation_alias="dualTone", serialization_alias="dualTone") + dualtone_frequency_in: Union[Variable, Global[int]] = Field( + validation_alias="dualtoneFrequencyIn", serialization_alias="dualtoneFrequencyIn" + ) + dualtone_frequency_out: Union[Variable, Global[int]] = Field( + validation_alias="dualtoneFrequencyOut", serialization_alias="dualtoneFrequencyOut" + ) + supervisory_name: Union[Variable, Global[str]] = Field( + validation_alias="supervisoryName", serialization_alias="supervisoryName" + ) + + +class SupervisoryCustomDetectionParams(BaseModel): + model_config = ConfigDict(populate_by_name=True) + cadence_variation: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="cadenceVariation", serialization_alias="cadenceVariation" + ) + max_delay: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="maxDelay", serialization_alias="maxDelay" + ) + max_deviation: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="maxDeviation", serialization_alias="maxDeviation" + ) + max_power: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="maxPower", serialization_alias="maxPower" + ) + min_power: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="minPower", serialization_alias="minPower" + ) + min_power_twist: Union[Variable, Default[int], Global[int]] = Field( + validation_alias="minPowerTwist", serialization_alias="minPowerTwist" + ) + supervisory_number: Optional[Union[Variable, Global[int]]] = Field( + default=None, validation_alias="supervisoryNumber", serialization_alias="supervisoryNumber" + ) + + +class SupervisoryDiconnectParcel(_ParcelBase): + type_: Literal["supervisory-disconnect"] = Field(default="supervisory-disconnect", exclude=True) + model_config = ConfigDict(populate_by_name=True) + supervisory_custom_c_p_tone: Optional[List[SupervisoryCustomCPTone]] = Field( + default=None, + validation_alias=AliasPath("data", "supervisoryCustomCPTone"), + ) + supervisory_custom_detection_params: Optional[List[SupervisoryCustomDetectionParams]] = Field( + default=None, + validation_alias=AliasPath("data", "supervisoryCustomDetectionParams"), + ) diff --git a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/voice_global.py b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/voice_global.py new file mode 100644 index 00000000..d3120ede --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/voice_global.py @@ -0,0 +1,55 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +from typing import List, Literal, Optional, Union + +from pydantic import AliasPath, BaseModel, ConfigDict, Field + +from catalystwan.api.configuration_groups.parcel import Default, Global, Variable, _ParcelBase + +IpFormat = Literal[ + "ipv4", + "ipv6", +] + + +class TrustedPrefixList(BaseModel): + model_config = ConfigDict(populate_by_name=True) + ip: Optional[Union[Variable, Default[None], Global[str]]] = Field(default=None) + ip_format: Optional[Union[Variable, Default[None], Global[IpFormat]]] = Field( + default=None, validation_alias="ipFormat", serialization_alias="ipFormat" + ) + + +class ClockPrioritySorting(BaseModel): + model_config = ConfigDict(populate_by_name=True) + clock_priority: Optional[Global[int]] = Field( + default=None, validation_alias="clockPriority", serialization_alias="clockPriority" + ) + clock_priority_sorting_port: Optional[Union[Variable, Default[None], Global[str]]] = Field( + default=None, validation_alias="clockPrioritySortingPort", serialization_alias="clockPrioritySortingPort" + ) + + +class VoiceGlobalParcel(_ParcelBase): + type_: Literal["voice-global"] = Field(default="voice-global", exclude=True) + model_config = ConfigDict(populate_by_name=True) + clock_priority_sorting: Optional[List[ClockPrioritySorting]] = Field( + default=None, + validation_alias=AliasPath("data", "clockPrioritySorting"), + description="Clock Priority Sorting", + ) + source_interface: Optional[Union[Variable, Default[None], Global[str]]] = Field( + default=None, + validation_alias=AliasPath("data", "sourceInterface"), + ) + sync: Optional[Union[Variable, Default[bool], Global[bool]]] = Field( + default=None, validation_alias=AliasPath("data", "sync") + ) + trusted_prefix_list: Optional[List[TrustedPrefixList]] = Field( + default=None, + validation_alias=AliasPath("data", "trustedPrefixList"), + description="Prefix List", + ) + wait_to_restore: Optional[Union[Variable, Default[int], Global[int]]] = Field( + default=None, + validation_alias=AliasPath("data", "waitToRestore"), + ) diff --git a/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/voice_tenant.py b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/voice_tenant.py new file mode 100644 index 00000000..d8491858 --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/uc_voice/voice_tenant.py @@ -0,0 +1,40 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +from typing import Literal, Optional, Union + +from pydantic import AliasPath, ConfigDict, Field + +from catalystwan.api.configuration_groups.parcel import Default, Global, Variable, _ParcelBase + +BindInterface = Literal[ + "Both", + "Control", + "Disabled", + "Media", +] + + +TransportType = Literal[ + "TCP", + "TCP TLS", + "UDP", +] + + +class VoiceTenantParcel(_ParcelBase): + type_: Literal["voice-tenant"] = Field(default="voice-tenant", exclude=True) + model_config = ConfigDict(populate_by_name=True) + bind_interface: Union[Variable, Global[BindInterface], Default[Literal["Disabled"]]] = Field( + validation_alias=AliasPath("data", "bindInterface") + ) + transport_type: Union[Variable, Global[TransportType], Default[Literal["UDP"]]] = Field( + validation_alias=AliasPath("data", "transportType") + ) + voice_tenant_tag: Union[Variable, Global[int]] = Field(validation_alias=AliasPath("data", "voiceTenantTag")) + bind_control_interface_name: Optional[Union[Variable, Global[str]]] = Field( + default=None, + validation_alias=AliasPath("data", "bindControlInterfaceName"), + ) + bind_media_interface_name: Optional[Union[Variable, Global[str]]] = Field( + default=None, + validation_alias=AliasPath("data", "bindMediaInterfaceName"), + )