Skip to content

Commit

Permalink
Update auto generated go snappi
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 5, 2024
1 parent 7e49de8 commit 210d5e6
Show file tree
Hide file tree
Showing 24 changed files with 26,969 additions and 26,472 deletions.
34 changes: 17 additions & 17 deletions gosnappi/bgp_attributes_community.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@ type BgpAttributesCommunity interface {
setChoice(value BgpAttributesCommunityChoiceEnum) BgpAttributesCommunity
// getter for NoLlgr to set choice.
NoLlgr()
// getter for NoAdvertised to set choice.
NoAdvertised()
// getter for NoExport to set choice.
NoExport()
// getter for LlgrStale to set choice.
LlgrStale()
// getter for NoExportSubconfed to set choice.
NoExportSubconfed()
// getter for LlgrStale to set choice.
LlgrStale()
// getter for NoExport to set choice.
NoExport()
// getter for NoAdvertised to set choice.
NoAdvertised()
// CustomCommunity returns BgpAttributesCustomCommunity, set in BgpAttributesCommunity.
// BgpAttributesCustomCommunity is user defined COMMUNITY attribute containing 2 byte AS and custom 2 byte value defined by the administrator of the domain.
CustomCommunity() BgpAttributesCustomCommunity
Expand Down Expand Up @@ -327,24 +327,24 @@ func (obj *bgpAttributesCommunity) NoLlgr() {
obj.setChoice(BgpAttributesCommunityChoice.NO_LLGR)
}

// getter for NoAdvertised to set choice
func (obj *bgpAttributesCommunity) NoAdvertised() {
obj.setChoice(BgpAttributesCommunityChoice.NO_ADVERTISED)
}

// getter for NoExport to set choice
func (obj *bgpAttributesCommunity) NoExport() {
obj.setChoice(BgpAttributesCommunityChoice.NO_EXPORT)
// getter for NoExportSubconfed to set choice
func (obj *bgpAttributesCommunity) NoExportSubconfed() {
obj.setChoice(BgpAttributesCommunityChoice.NO_EXPORT_SUBCONFED)
}

// getter for LlgrStale to set choice
func (obj *bgpAttributesCommunity) LlgrStale() {
obj.setChoice(BgpAttributesCommunityChoice.LLGR_STALE)
}

// getter for NoExportSubconfed to set choice
func (obj *bgpAttributesCommunity) NoExportSubconfed() {
obj.setChoice(BgpAttributesCommunityChoice.NO_EXPORT_SUBCONFED)
// getter for NoExport to set choice
func (obj *bgpAttributesCommunity) NoExport() {
obj.setChoice(BgpAttributesCommunityChoice.NO_EXPORT)
}

// getter for NoAdvertised to set choice
func (obj *bgpAttributesCommunity) NoAdvertised() {
obj.setChoice(BgpAttributesCommunityChoice.NO_ADVERTISED)
}

func (obj *bgpAttributesCommunity) setChoice(value BgpAttributesCommunityChoiceEnum) BgpAttributesCommunity {
Expand Down
28 changes: 14 additions & 14 deletions gosnappi/bgp_attributes_sr_policy_explicit_null_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,16 @@ type BgpAttributesSrPolicyExplicitNullPolicy interface {
setChoice(value BgpAttributesSrPolicyExplicitNullPolicyChoiceEnum) BgpAttributesSrPolicyExplicitNullPolicy
// HasChoice checks if Choice has been set in BgpAttributesSrPolicyExplicitNullPolicy
HasChoice() bool
// getter for PushIpv4AndIpv6 to set choice.
PushIpv4AndIpv6()
// getter for Unknown to set choice.
Unknown()
// getter for PushIpv4 to set choice.
PushIpv4()
// getter for PushIpv6 to set choice.
PushIpv6()
// getter for PushIpv4AndIpv6 to set choice.
PushIpv4AndIpv6()
// getter for DonotPush to set choice.
DonotPush()
// getter for PushIpv6 to set choice.
PushIpv6()
}

type BgpAttributesSrPolicyExplicitNullPolicyChoiceEnum string
Expand All @@ -305,6 +305,11 @@ func (obj *bgpAttributesSrPolicyExplicitNullPolicy) Choice() BgpAttributesSrPoli
return BgpAttributesSrPolicyExplicitNullPolicyChoiceEnum(obj.obj.Choice.Enum().String())
}

// getter for PushIpv4AndIpv6 to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) PushIpv4AndIpv6() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.PUSH_IPV4_AND_IPV6)
}

// getter for Unknown to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) Unknown() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.UNKNOWN)
Expand All @@ -315,21 +320,16 @@ func (obj *bgpAttributesSrPolicyExplicitNullPolicy) PushIpv4() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.PUSH_IPV4)
}

// getter for PushIpv6 to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) PushIpv6() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.PUSH_IPV6)
}

// getter for PushIpv4AndIpv6 to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) PushIpv4AndIpv6() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.PUSH_IPV4_AND_IPV6)
}

// getter for DonotPush to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) DonotPush() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.DONOT_PUSH)
}

// getter for PushIpv6 to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) PushIpv6() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.PUSH_IPV6)
}

// The Explicit NULL Label policy.
// Choice returns a string
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) HasChoice() bool {
Expand Down
134 changes: 31 additions & 103 deletions gosnappi/device_ospfv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type deviceOspfv2 struct {
obj *otg.DeviceOspfv2
marshaller marshalDeviceOspfv2
unMarshaller unMarshalDeviceOspfv2
routerIdHolder Ospfv2RouterId
gracefulRestartHolder Ospfv2GracefulRestart
capabilitiesHolder Ospfv2Options
interfacesHolder DeviceOspfv2Ospfv2InterfaceIter
Expand Down Expand Up @@ -247,6 +248,7 @@ func (obj *deviceOspfv2) Clone() (DeviceOspfv2, error) {
}

func (obj *deviceOspfv2) setNil() {
obj.routerIdHolder = nil
obj.gracefulRestartHolder = nil
obj.capabilitiesHolder = nil
obj.interfacesHolder = nil
Expand Down Expand Up @@ -282,20 +284,14 @@ type DeviceOspfv2 interface {
Name() string
// SetName assigns string provided by user to DeviceOspfv2
SetName(value string) DeviceOspfv2
// Choice returns DeviceOspfv2ChoiceEnum, set in DeviceOspfv2
Choice() DeviceOspfv2ChoiceEnum
// setChoice assigns DeviceOspfv2ChoiceEnum provided by user to DeviceOspfv2
setChoice(value DeviceOspfv2ChoiceEnum) DeviceOspfv2
// HasChoice checks if Choice has been set in DeviceOspfv2
HasChoice() bool
// getter for InterfaceIp to set choice.
InterfaceIp()
// CustomRouterId returns string, set in DeviceOspfv2.
CustomRouterId() string
// SetCustomRouterId assigns string provided by user to DeviceOspfv2
SetCustomRouterId(value string) DeviceOspfv2
// HasCustomRouterId checks if CustomRouterId has been set in DeviceOspfv2
HasCustomRouterId() bool
// RouterId returns Ospfv2RouterId, set in DeviceOspfv2.
// Ospfv2RouterId is containter for OSPFv2 Router ID configuration.
RouterId() Ospfv2RouterId
// SetRouterId assigns Ospfv2RouterId provided by user to DeviceOspfv2.
// Ospfv2RouterId is containter for OSPFv2 Router ID configuration.
SetRouterId(value Ospfv2RouterId) DeviceOspfv2
// HasRouterId checks if RouterId has been set in DeviceOspfv2
HasRouterId() bool
// LsaRetransmitTimer returns uint32, set in DeviceOspfv2.
LsaRetransmitTimer() uint32
// SetLsaRetransmitTimer assigns uint32 provided by user to DeviceOspfv2
Expand Down Expand Up @@ -377,70 +373,31 @@ func (obj *deviceOspfv2) SetName(value string) DeviceOspfv2 {
return obj
}

type DeviceOspfv2ChoiceEnum string

// Enum of Choice on DeviceOspfv2
var DeviceOspfv2Choice = struct {
INTERFACE_IP DeviceOspfv2ChoiceEnum
CUSTOM_ROUTER_ID DeviceOspfv2ChoiceEnum
}{
INTERFACE_IP: DeviceOspfv2ChoiceEnum("interface_ip"),
CUSTOM_ROUTER_ID: DeviceOspfv2ChoiceEnum("custom_router_id"),
}

func (obj *deviceOspfv2) Choice() DeviceOspfv2ChoiceEnum {
return DeviceOspfv2ChoiceEnum(obj.obj.Choice.Enum().String())
}

// getter for InterfaceIp to set choice
func (obj *deviceOspfv2) InterfaceIp() {
obj.setChoice(DeviceOspfv2Choice.INTERFACE_IP)
}

// IP address of Router ID for this emulated OSPFv2 router.
// - interface_ip: When IPv4 interface address to be assigned as Router ID.
// - custom_router_id: When, Router ID needs to be configured different from Interface IPv4 address.
// Choice returns a string
func (obj *deviceOspfv2) HasChoice() bool {
return obj.obj.Choice != nil
}

func (obj *deviceOspfv2) setChoice(value DeviceOspfv2ChoiceEnum) DeviceOspfv2 {
intValue, ok := otg.DeviceOspfv2_Choice_Enum_value[string(value)]
if !ok {
obj.validationErrors = append(obj.validationErrors, fmt.Sprintf(
"%s is not a valid choice on DeviceOspfv2ChoiceEnum", string(value)))
return obj
// OSPFv2 Router Id.
// RouterId returns a Ospfv2RouterId
func (obj *deviceOspfv2) RouterId() Ospfv2RouterId {
if obj.obj.RouterId == nil {
obj.obj.RouterId = NewOspfv2RouterId().msg()
}
enumValue := otg.DeviceOspfv2_Choice_Enum(intValue)
obj.obj.Choice = &enumValue
obj.obj.CustomRouterId = nil
return obj
}

// Router ID in IPv4 address format.
// CustomRouterId returns a string
func (obj *deviceOspfv2) CustomRouterId() string {

if obj.obj.CustomRouterId == nil {
obj.setChoice(DeviceOspfv2Choice.CUSTOM_ROUTER_ID)
if obj.routerIdHolder == nil {
obj.routerIdHolder = &ospfv2RouterId{obj: obj.obj.RouterId}
}

return *obj.obj.CustomRouterId

return obj.routerIdHolder
}

// Router ID in IPv4 address format.
// CustomRouterId returns a string
func (obj *deviceOspfv2) HasCustomRouterId() bool {
return obj.obj.CustomRouterId != nil
// OSPFv2 Router Id.
// RouterId returns a Ospfv2RouterId
func (obj *deviceOspfv2) HasRouterId() bool {
return obj.obj.RouterId != nil
}

// Router ID in IPv4 address format.
// SetCustomRouterId sets the string value in the DeviceOspfv2 object
func (obj *deviceOspfv2) SetCustomRouterId(value string) DeviceOspfv2 {
obj.setChoice(DeviceOspfv2Choice.CUSTOM_ROUTER_ID)
obj.obj.CustomRouterId = &value
// OSPFv2 Router Id.
// SetRouterId sets the Ospfv2RouterId value in the DeviceOspfv2 object
func (obj *deviceOspfv2) SetRouterId(value Ospfv2RouterId) DeviceOspfv2 {

obj.routerIdHolder = nil
obj.obj.RouterId = value.msg()

return obj
}

Expand Down Expand Up @@ -794,13 +751,9 @@ func (obj *deviceOspfv2) validateObj(vObj *validation, set_default bool) {
vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface DeviceOspfv2")
}

if obj.obj.CustomRouterId != nil {

err := obj.validateIpv4(obj.CustomRouterId())
if err != nil {
vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("%s %s", err.Error(), "on DeviceOspfv2.CustomRouterId"))
}
if obj.obj.RouterId != nil {

obj.RouterId().validateObj(vObj, set_default)
}

if obj.obj.LsaRetransmitTimer != nil {
Expand Down Expand Up @@ -874,31 +827,6 @@ func (obj *deviceOspfv2) validateObj(vObj *validation, set_default bool) {
}

func (obj *deviceOspfv2) setDefault() {
var choices_set int = 0
var choice DeviceOspfv2ChoiceEnum

if obj.obj.CustomRouterId != nil {
choices_set += 1
choice = DeviceOspfv2Choice.CUSTOM_ROUTER_ID
}
if choices_set == 0 {
if obj.obj.Choice == nil {
obj.setChoice(DeviceOspfv2Choice.INTERFACE_IP)

}

} else if choices_set == 1 && choice != "" {
if obj.obj.Choice != nil {
if obj.Choice() != choice {
obj.validationErrors = append(obj.validationErrors, "choice not matching with property in DeviceOspfv2")
}
} else {
intVal := otg.DeviceOspfv2_Choice_Enum_value[string(choice)]
enumValue := otg.DeviceOspfv2_Choice_Enum(intVal)
obj.obj.Choice = &enumValue
}
}

if obj.obj.LsaRetransmitTimer == nil {
obj.SetLsaRetransmitTimer(5)
}
Expand Down
34 changes: 17 additions & 17 deletions gosnappi/dhcpv6_client_options_duid_uuid_variant.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ type Dhcpv6ClientOptionsDuidUuidVariant interface {
setChoice(value Dhcpv6ClientOptionsDuidUuidVariantChoiceEnum) Dhcpv6ClientOptionsDuidUuidVariant
// HasChoice checks if Choice has been set in Dhcpv6ClientOptionsDuidUuidVariant
HasChoice() bool
// getter for Guid to set choice.
Guid()
// getter for Ncs to set choice.
Ncs()
// getter for VarReserved to set choice.
VarReserved()
// getter for Dce to set choice.
Dce()
// getter for VarReserved to set choice.
VarReserved()
// getter for Ncs to set choice.
Ncs()
// getter for Guid to set choice.
Guid()
}

type Dhcpv6ClientOptionsDuidUuidVariantChoiceEnum string
Expand All @@ -299,24 +299,24 @@ func (obj *dhcpv6ClientOptionsDuidUuidVariant) Choice() Dhcpv6ClientOptionsDuidU
return Dhcpv6ClientOptionsDuidUuidVariantChoiceEnum(obj.obj.Choice.Enum().String())
}

// getter for Guid to set choice
func (obj *dhcpv6ClientOptionsDuidUuidVariant) Guid() {
obj.setChoice(Dhcpv6ClientOptionsDuidUuidVariantChoice.GUID)
}

// getter for Ncs to set choice
func (obj *dhcpv6ClientOptionsDuidUuidVariant) Ncs() {
obj.setChoice(Dhcpv6ClientOptionsDuidUuidVariantChoice.NCS)
// getter for Dce to set choice
func (obj *dhcpv6ClientOptionsDuidUuidVariant) Dce() {
obj.setChoice(Dhcpv6ClientOptionsDuidUuidVariantChoice.DCE)
}

// getter for VarReserved to set choice
func (obj *dhcpv6ClientOptionsDuidUuidVariant) VarReserved() {
obj.setChoice(Dhcpv6ClientOptionsDuidUuidVariantChoice.VAR_RESERVED)
}

// getter for Dce to set choice
func (obj *dhcpv6ClientOptionsDuidUuidVariant) Dce() {
obj.setChoice(Dhcpv6ClientOptionsDuidUuidVariantChoice.DCE)
// getter for Ncs to set choice
func (obj *dhcpv6ClientOptionsDuidUuidVariant) Ncs() {
obj.setChoice(Dhcpv6ClientOptionsDuidUuidVariantChoice.NCS)
}

// getter for Guid to set choice
func (obj *dhcpv6ClientOptionsDuidUuidVariant) Guid() {
obj.setChoice(Dhcpv6ClientOptionsDuidUuidVariantChoice.GUID)
}

// The current variants are ncs, dce,microsoft guid and reserved.
Expand Down
Loading

0 comments on commit 210d5e6

Please sign in to comment.