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 Aug 16, 2024
1 parent f4abc85 commit 8ab0a7e
Show file tree
Hide file tree
Showing 72 changed files with 106,569 additions and 68,364 deletions.
34 changes: 17 additions & 17 deletions gosnappi/bgp_attributes_community.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,16 @@ type BgpAttributesCommunity interface {
Choice() BgpAttributesCommunityChoiceEnum
// setChoice assigns BgpAttributesCommunityChoiceEnum provided by user to BgpAttributesCommunity
setChoice(value BgpAttributesCommunityChoiceEnum) BgpAttributesCommunity
// getter for NoExportSubconfed to set choice.
NoExportSubconfed()
// getter for LlgrStale to set choice.
LlgrStale()
// 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 NoLlgr to set choice.
NoLlgr()
// getter for NoExportSubconfed to set choice.
NoExportSubconfed()
// 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 @@ -322,9 +322,14 @@ func (obj *bgpAttributesCommunity) Choice() BgpAttributesCommunityChoiceEnum {
return BgpAttributesCommunityChoiceEnum(obj.obj.Choice.Enum().String())
}

// getter for NoExportSubconfed to set choice
func (obj *bgpAttributesCommunity) NoExportSubconfed() {
obj.setChoice(BgpAttributesCommunityChoice.NO_EXPORT_SUBCONFED)
// 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 LlgrStale to set choice
Expand All @@ -337,14 +342,9 @@ 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)
}

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

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

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

// 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 Unknown to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) Unknown() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.UNKNOWN)
}

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

// getter for PushIpv4 to set choice
Expand Down
8 changes: 4 additions & 4 deletions gosnappi/bgp_v4_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ type BgpV4Interface interface {
// x-constraint:
// - /components/schemas/Device.Ipv4/properties/name
// - /components/schemas/Device.Ipv4Loopback/properties/name
// - /components/schemas/DhcpClient.V4/properties/name
// - /components/schemas/Device.Dhcpv4client/properties/name
//
// x-constraint:
// - /components/schemas/Device.Ipv4/properties/name
// - /components/schemas/Device.Ipv4Loopback/properties/name
// - /components/schemas/DhcpClient.V4/properties/name
// - /components/schemas/Device.Dhcpv4client/properties/name
//
// Ipv4Name returns a string
func (obj *bgpV4Interface) Ipv4Name() string {
Expand All @@ -305,12 +305,12 @@ func (obj *bgpV4Interface) Ipv4Name() string {
// x-constraint:
// - /components/schemas/Device.Ipv4/properties/name
// - /components/schemas/Device.Ipv4Loopback/properties/name
// - /components/schemas/DhcpClient.V4/properties/name
// - /components/schemas/Device.Dhcpv4client/properties/name
//
// x-constraint:
// - /components/schemas/Device.Ipv4/properties/name
// - /components/schemas/Device.Ipv4Loopback/properties/name
// - /components/schemas/DhcpClient.V4/properties/name
// - /components/schemas/Device.Dhcpv4client/properties/name
//
// SetIpv4Name sets the string value in the BgpV4Interface object
func (obj *bgpV4Interface) SetIpv4Name(value string) BgpV4Interface {
Expand Down
8 changes: 4 additions & 4 deletions gosnappi/bgp_v6_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ type BgpV6Interface interface {
// x-constraint:
// - /components/schemas/Device.Ipv6/properties/name
// - /components/schemas/Device.Ipv6Loopback/properties/name
// - /components/schemas/DhcpClient.V6/properties/name
// - /components/schemas/Device.Dhcpv6client/properties/name
//
// x-constraint:
// - /components/schemas/Device.Ipv6/properties/name
// - /components/schemas/Device.Ipv6Loopback/properties/name
// - /components/schemas/DhcpClient.V6/properties/name
// - /components/schemas/Device.Dhcpv6client/properties/name
//
// Ipv6Name returns a string
func (obj *bgpV6Interface) Ipv6Name() string {
Expand All @@ -305,12 +305,12 @@ func (obj *bgpV6Interface) Ipv6Name() string {
// x-constraint:
// - /components/schemas/Device.Ipv6/properties/name
// - /components/schemas/Device.Ipv6Loopback/properties/name
// - /components/schemas/DhcpClient.V6/properties/name
// - /components/schemas/Device.Dhcpv6client/properties/name
//
// x-constraint:
// - /components/schemas/Device.Ipv6/properties/name
// - /components/schemas/Device.Ipv6Loopback/properties/name
// - /components/schemas/DhcpClient.V6/properties/name
// - /components/schemas/Device.Dhcpv6client/properties/name
//
// SetIpv6Name sets the string value in the BgpV6Interface object
func (obj *bgpV6Interface) SetIpv6Name(value string) BgpV6Interface {
Expand Down
105 changes: 105 additions & 0 deletions gosnappi/device_dhcp_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type deviceDhcpServer struct {
marshaller marshalDeviceDhcpServer
unMarshaller unMarshalDeviceDhcpServer
ipv4InterfacesHolder DeviceDhcpServerDhcpServerV4Iter
ipv6InterfacesHolder DeviceDhcpServerDhcpServerV6Iter
}

func NewDeviceDhcpServer() DeviceDhcpServer {
Expand Down Expand Up @@ -245,6 +246,7 @@ func (obj *deviceDhcpServer) Clone() (DeviceDhcpServer, error) {

func (obj *deviceDhcpServer) setNil() {
obj.ipv4InterfacesHolder = nil
obj.ipv6InterfacesHolder = nil
obj.validationErrors = nil
obj.warnings = nil
obj.constraints = make(map[string]map[string]Constraints)
Expand Down Expand Up @@ -274,6 +276,8 @@ type DeviceDhcpServer interface {
setDefault()
// Ipv4Interfaces returns DeviceDhcpServerDhcpServerV4IterIter, set in DeviceDhcpServer
Ipv4Interfaces() DeviceDhcpServerDhcpServerV4Iter
// Ipv6Interfaces returns DeviceDhcpServerDhcpServerV6IterIter, set in DeviceDhcpServer
Ipv6Interfaces() DeviceDhcpServerDhcpServerV6Iter
setNil()
}

Expand Down Expand Up @@ -364,6 +368,93 @@ func (obj *deviceDhcpServerDhcpServerV4Iter) appendHolderSlice(item DhcpServerV4
return obj
}

// This contains an array of references to IPv6 interfaces, each of which will contain one DHCPv6 server.
// Ipv6Interfaces returns a []DhcpServerV6
func (obj *deviceDhcpServer) Ipv6Interfaces() DeviceDhcpServerDhcpServerV6Iter {
if len(obj.obj.Ipv6Interfaces) == 0 {
obj.obj.Ipv6Interfaces = []*otg.DhcpServerV6{}
}
if obj.ipv6InterfacesHolder == nil {
obj.ipv6InterfacesHolder = newDeviceDhcpServerDhcpServerV6Iter(&obj.obj.Ipv6Interfaces).setMsg(obj)
}
return obj.ipv6InterfacesHolder
}

type deviceDhcpServerDhcpServerV6Iter struct {
obj *deviceDhcpServer
dhcpServerV6Slice []DhcpServerV6
fieldPtr *[]*otg.DhcpServerV6
}

func newDeviceDhcpServerDhcpServerV6Iter(ptr *[]*otg.DhcpServerV6) DeviceDhcpServerDhcpServerV6Iter {
return &deviceDhcpServerDhcpServerV6Iter{fieldPtr: ptr}
}

type DeviceDhcpServerDhcpServerV6Iter interface {
setMsg(*deviceDhcpServer) DeviceDhcpServerDhcpServerV6Iter
Items() []DhcpServerV6
Add() DhcpServerV6
Append(items ...DhcpServerV6) DeviceDhcpServerDhcpServerV6Iter
Set(index int, newObj DhcpServerV6) DeviceDhcpServerDhcpServerV6Iter
Clear() DeviceDhcpServerDhcpServerV6Iter
clearHolderSlice() DeviceDhcpServerDhcpServerV6Iter
appendHolderSlice(item DhcpServerV6) DeviceDhcpServerDhcpServerV6Iter
}

func (obj *deviceDhcpServerDhcpServerV6Iter) setMsg(msg *deviceDhcpServer) DeviceDhcpServerDhcpServerV6Iter {
obj.clearHolderSlice()
for _, val := range *obj.fieldPtr {
obj.appendHolderSlice(&dhcpServerV6{obj: val})
}
obj.obj = msg
return obj
}

func (obj *deviceDhcpServerDhcpServerV6Iter) Items() []DhcpServerV6 {
return obj.dhcpServerV6Slice
}

func (obj *deviceDhcpServerDhcpServerV6Iter) Add() DhcpServerV6 {
newObj := &otg.DhcpServerV6{}
*obj.fieldPtr = append(*obj.fieldPtr, newObj)
newLibObj := &dhcpServerV6{obj: newObj}
newLibObj.setDefault()
obj.dhcpServerV6Slice = append(obj.dhcpServerV6Slice, newLibObj)
return newLibObj
}

func (obj *deviceDhcpServerDhcpServerV6Iter) Append(items ...DhcpServerV6) DeviceDhcpServerDhcpServerV6Iter {
for _, item := range items {
newObj := item.msg()
*obj.fieldPtr = append(*obj.fieldPtr, newObj)
obj.dhcpServerV6Slice = append(obj.dhcpServerV6Slice, item)
}
return obj
}

func (obj *deviceDhcpServerDhcpServerV6Iter) Set(index int, newObj DhcpServerV6) DeviceDhcpServerDhcpServerV6Iter {
(*obj.fieldPtr)[index] = newObj.msg()
obj.dhcpServerV6Slice[index] = newObj
return obj
}
func (obj *deviceDhcpServerDhcpServerV6Iter) Clear() DeviceDhcpServerDhcpServerV6Iter {
if len(*obj.fieldPtr) > 0 {
*obj.fieldPtr = []*otg.DhcpServerV6{}
obj.dhcpServerV6Slice = []DhcpServerV6{}
}
return obj
}
func (obj *deviceDhcpServerDhcpServerV6Iter) clearHolderSlice() DeviceDhcpServerDhcpServerV6Iter {
if len(obj.dhcpServerV6Slice) > 0 {
obj.dhcpServerV6Slice = []DhcpServerV6{}
}
return obj
}
func (obj *deviceDhcpServerDhcpServerV6Iter) appendHolderSlice(item DhcpServerV6) DeviceDhcpServerDhcpServerV6Iter {
obj.dhcpServerV6Slice = append(obj.dhcpServerV6Slice, item)
return obj
}

func (obj *deviceDhcpServer) validateObj(vObj *validation, set_default bool) {
if set_default {
obj.setDefault()
Expand All @@ -383,6 +474,20 @@ func (obj *deviceDhcpServer) validateObj(vObj *validation, set_default bool) {

}

if len(obj.obj.Ipv6Interfaces) != 0 {

if set_default {
obj.Ipv6Interfaces().clearHolderSlice()
for _, item := range obj.obj.Ipv6Interfaces {
obj.Ipv6Interfaces().appendHolderSlice(&dhcpServerV6{obj: item})
}
}
for _, item := range obj.Ipv6Interfaces().Items() {
item.validateObj(vObj, set_default)
}

}

}

func (obj *deviceDhcpServer) setDefault() {
Expand Down
Loading

0 comments on commit 8ab0a7e

Please sign in to comment.