Skip to content

Commit

Permalink
[bugfix] Fix naming convention of the dhcpRelayGwExtIp model and clie…
Browse files Browse the repository at this point in the history
…nt files (#251)
  • Loading branch information
sajagana authored Jan 11, 2023
1 parent eee65df commit 6346716
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
18 changes: 9 additions & 9 deletions client/dhcpRelayGwExtIp_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@ import (
"github.com/ciscoecosystem/aci-go-client/v2/models"
)

func (sm *ServiceManager) CreateUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string, description string, dhcpRelayGwExtIpAttr models.UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes) (*models.UsetheexternalsecondaryaddressforDHCPrelaygateway, error) {
dhcpRelayGwExtIp := models.NewUsetheexternalsecondaryaddressforDHCPrelaygateway(models.RndhcpRelayGwExtIp, parentDn, description, dhcpRelayGwExtIpAttr)
func (sm *ServiceManager) CreateDhcpRelayGwExtIp(parentDn string, description string, dhcpRelayGwExtIpAttr models.DhcpRelayGwExtIpAttributes) (*models.DhcpRelayGwExtIp, error) {
dhcpRelayGwExtIp := models.NewDhcpRelayGwExtIp(models.RndhcpRelayGwExtIp, parentDn, description, dhcpRelayGwExtIpAttr)
err := sm.Save(dhcpRelayGwExtIp)
return dhcpRelayGwExtIp, err
}

func (sm *ServiceManager) ReadUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string) (*models.UsetheexternalsecondaryaddressforDHCPrelaygateway, error) {
func (sm *ServiceManager) ReadDhcpRelayGwExtIp(parentDn string) (*models.DhcpRelayGwExtIp, error) {
dn := fmt.Sprintf("%s/%s", parentDn, models.RndhcpRelayGwExtIp)

cont, err := sm.Get(dn)
if err != nil {
return nil, err
}

dhcpRelayGwExtIp := models.UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainer(cont)
dhcpRelayGwExtIp := models.DhcpRelayGwExtIpFromContainer(cont)
return dhcpRelayGwExtIp, nil
}

func (sm *ServiceManager) DeleteUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string) error {
func (sm *ServiceManager) DeleteDhcpRelayGwExtIp(parentDn string) error {
dn := fmt.Sprintf("%s/%s", parentDn, models.RndhcpRelayGwExtIp)
return sm.DeleteByDn(dn, models.DhcprelaygwextipClassName)
}

func (sm *ServiceManager) UpdateUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string, description string, dhcpRelayGwExtIpAttr models.UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes) (*models.UsetheexternalsecondaryaddressforDHCPrelaygateway, error) {
dhcpRelayGwExtIp := models.NewUsetheexternalsecondaryaddressforDHCPrelaygateway(models.RndhcpRelayGwExtIp, parentDn, description, dhcpRelayGwExtIpAttr)
func (sm *ServiceManager) UpdateDhcpRelayGwExtIp(parentDn string, description string, dhcpRelayGwExtIpAttr models.DhcpRelayGwExtIpAttributes) (*models.DhcpRelayGwExtIp, error) {
dhcpRelayGwExtIp := models.NewDhcpRelayGwExtIp(models.RndhcpRelayGwExtIp, parentDn, description, dhcpRelayGwExtIpAttr)
dhcpRelayGwExtIp.Status = "modified"
err := sm.Save(dhcpRelayGwExtIp)
return dhcpRelayGwExtIp, err
}

func (sm *ServiceManager) ListUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string) ([]*models.UsetheexternalsecondaryaddressforDHCPrelaygateway, error) {
func (sm *ServiceManager) ListDhcpRelayGwExtIp(parentDn string) ([]*models.DhcpRelayGwExtIp, error) {
dnUrl := fmt.Sprintf("%s/%s/dhcpRelayGwExtIp.json", models.BaseurlStr, parentDn)
cont, err := sm.GetViaURL(dnUrl)
list := models.UsetheexternalsecondaryaddressforDHCPrelaygatewayListFromContainer(cont)
list := models.DhcpRelayGwExtIpListFromContainer(cont)
return list, err
}
42 changes: 21 additions & 21 deletions models/dhcp_relay_gw_ext_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ const (
DhcprelaygwextipClassName = "dhcpRelayGwExtIp"
)

type UsetheexternalsecondaryaddressforDHCPrelaygateway struct {
type DhcpRelayGwExtIp struct {
BaseAttributes
UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes
DhcpRelayGwExtIpAttributes
}

type UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes struct {
type DhcpRelayGwExtIpAttributes struct {
Name string `json:",omitempty"`
}

func NewUsetheexternalsecondaryaddressforDHCPrelaygateway(dhcpRelayGwExtIpRn, parentDn, description string, dhcpRelayGwExtIpAttr UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes) *UsetheexternalsecondaryaddressforDHCPrelaygateway {
func NewDhcpRelayGwExtIp(dhcpRelayGwExtIpRn, parentDn, description string, dhcpRelayGwExtIpAttr DhcpRelayGwExtIpAttributes) *DhcpRelayGwExtIp {
dn := fmt.Sprintf("%s/%s", parentDn, dhcpRelayGwExtIpRn)
return &UsetheexternalsecondaryaddressforDHCPrelaygateway{
return &DhcpRelayGwExtIp{
BaseAttributes: BaseAttributes{
DistinguishedName: dn,
Description: description,
Status: "created, modified",
ClassName: DhcprelaygwextipClassName,
Rn: dhcpRelayGwExtIpRn,
},
UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes: dhcpRelayGwExtIpAttr,
DhcpRelayGwExtIpAttributes: dhcpRelayGwExtIpAttr,
}
}

func (dhcpRelayGwExtIp *UsetheexternalsecondaryaddressforDHCPrelaygateway) ToMap() (map[string]string, error) {
func (dhcpRelayGwExtIp *DhcpRelayGwExtIp) ToMap() (map[string]string, error) {
dhcpRelayGwExtIpMap, err := dhcpRelayGwExtIp.BaseAttributes.ToMap()
if err != nil {
return nil, err
Expand All @@ -45,32 +45,32 @@ func (dhcpRelayGwExtIp *UsetheexternalsecondaryaddressforDHCPrelaygateway) ToMap
return dhcpRelayGwExtIpMap, err
}

func UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainerList(cont *container.Container, index int) *UsetheexternalsecondaryaddressforDHCPrelaygateway {
UsetheexternalsecondaryaddressforDHCPrelaygatewayCont := cont.S("imdata").Index(index).S(DhcprelaygwextipClassName, "attributes")
return &UsetheexternalsecondaryaddressforDHCPrelaygateway{
func DhcpRelayGwExtIpFromContainerList(cont *container.Container, index int) *DhcpRelayGwExtIp {
DhcpRelayGwExtIpCont := cont.S("imdata").Index(index).S(DhcprelaygwextipClassName, "attributes")
return &DhcpRelayGwExtIp{
BaseAttributes{
DistinguishedName: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "dn"),
Description: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "descr"),
Status: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "status"),
DistinguishedName: G(DhcpRelayGwExtIpCont, "dn"),
Description: G(DhcpRelayGwExtIpCont, "descr"),
Status: G(DhcpRelayGwExtIpCont, "status"),
ClassName: DhcprelaygwextipClassName,
Rn: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "rn"),
Rn: G(DhcpRelayGwExtIpCont, "rn"),
},
UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes{
Name: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "name"),
DhcpRelayGwExtIpAttributes{
Name: G(DhcpRelayGwExtIpCont, "name"),
},
}
}

func UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainer(cont *container.Container) *UsetheexternalsecondaryaddressforDHCPrelaygateway {
return UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainerList(cont, 0)
func DhcpRelayGwExtIpFromContainer(cont *container.Container) *DhcpRelayGwExtIp {
return DhcpRelayGwExtIpFromContainerList(cont, 0)
}

func UsetheexternalsecondaryaddressforDHCPrelaygatewayListFromContainer(cont *container.Container) []*UsetheexternalsecondaryaddressforDHCPrelaygateway {
func DhcpRelayGwExtIpListFromContainer(cont *container.Container) []*DhcpRelayGwExtIp {
length, _ := strconv.Atoi(G(cont, "totalCount"))
arr := make([]*UsetheexternalsecondaryaddressforDHCPrelaygateway, length)
arr := make([]*DhcpRelayGwExtIp, length)

for i := 0; i < length; i++ {
arr[i] = UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainerList(cont, i)
arr[i] = DhcpRelayGwExtIpFromContainerList(cont, i)
}

return arr
Expand Down

0 comments on commit 6346716

Please sign in to comment.