Skip to content

Commit

Permalink
[minor_change] Removed SiteContractServiceGraphListener struct from s…
Browse files Browse the repository at this point in the history
…chema_template_contract_service_graph.go
  • Loading branch information
sajagana authored and lhercot committed Nov 27, 2023
1 parent 90d6d44 commit f7166df
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions models/schema_template_contract_service_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,39 +66,21 @@ func (graphAttr *SiteContractServiceGraph) ToMap() (map[string]interface{}, erro
return graphAttrMap, nil
}

type SiteContractServiceGraphListener struct {
Ops string `json:",omitempty"`
Path string `json:",omitempty"`
Value map[string]interface{} `json:",omitempty"`
}
func NewSiteContractServiceGraphListener(ops, path, name, protocol, securityPolicy string, port int, certificates []interface{}, rules []interface{}, frontendIpDnMap map[string]string) *PatchPayload {

func NewSiteContractServiceGraphListener(ops, path, name, protocol, securityPolicy string, port int, certificates []interface{}, rules []interface{}, frontendIpDnMap map[string]string) *SiteContractServiceGraphListener {
var listenerMap map[string]interface{}
if ops != "remove" {
listenerMap = map[string]interface{}{
"name": name,
"port": port,
"protocol": protocol,
"secPolicy": securityPolicy,
"certificates": certificates,
"rules": rules,
"nlbDevIp": frontendIpDnMap,
}
listenerMap := map[string]interface{}{
"name": name,
"port": port,
"protocol": protocol,
"secPolicy": securityPolicy,
"certificates": certificates,
"rules": rules,
"nlbDevIp": frontendIpDnMap,
}

return &SiteContractServiceGraphListener{
return &PatchPayload{
Ops: ops,
Path: path,
Value: listenerMap,
}
}

func (listenerAttr *SiteContractServiceGraphListener) ToMap() (map[string]interface{}, error) {
listenerAttrMap := make(map[string]interface{})
A(listenerAttrMap, "op", listenerAttr.Ops)
A(listenerAttrMap, "path", listenerAttr.Path)
if listenerAttr.Value != nil {
A(listenerAttrMap, "value", listenerAttr.Value)
}
return listenerAttrMap, nil
}

0 comments on commit f7166df

Please sign in to comment.