Skip to content

Commit

Permalink
Add missing conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
seconroy committed Jul 25, 2024
1 parent c0f0f1e commit 42ac6da
Show file tree
Hide file tree
Showing 34 changed files with 4,373 additions and 2,434 deletions.
881 changes: 445 additions & 436 deletions gen/templates/profile_parcels/model.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -80,34 +80,46 @@ func (data ApplicationPriorityQoSPolicy) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"target.interfaces.value", data.TargetInterfaceVariable.ValueString())
}
} else if !data.TargetInterface.IsNull() {
body, _ = sjson.Set(body, path+"target.interfaces.optionType", "global")
var values []string
data.TargetInterface.ElementsAs(ctx, &values, false)
body, _ = sjson.Set(body, path+"target.interfaces.value", values)
if true {
body, _ = sjson.Set(body, path+"target.interfaces.optionType", "global")
var values []string
data.TargetInterface.ElementsAs(ctx, &values, false)
body, _ = sjson.Set(body, path+"target.interfaces.value", values)
}
}
if true {
body, _ = sjson.Set(body, path+"qosMap.qosSchedulers", []interface{}{})
for _, item := range data.QosSchedulers {
itemBody := ""
if !item.ForwardingClassId.IsNull() {
itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.value", item.ForwardingClassId.ValueString())
if true {
itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.value", item.ForwardingClassId.ValueString())
}
}
if !item.Drops.IsNull() {
itemBody, _ = sjson.Set(itemBody, "drops.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "drops.value", item.Drops.ValueString())
if true {
itemBody, _ = sjson.Set(itemBody, "drops.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "drops.value", item.Drops.ValueString())
}
}
if !item.Queue.IsNull() {
itemBody, _ = sjson.Set(itemBody, "queue.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "queue.value", item.Queue.ValueString())
if true {
itemBody, _ = sjson.Set(itemBody, "queue.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "queue.value", item.Queue.ValueString())
}
}
if !item.Bandwidth.IsNull() {
itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.value", item.Bandwidth.ValueString())
if true {
itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.value", item.Bandwidth.ValueString())
}
}
if !item.SchedulingType.IsNull() {
itemBody, _ = sjson.Set(itemBody, "scheduling.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "scheduling.value", item.SchedulingType.ValueString())
if true {
itemBody, _ = sjson.Set(itemBody, "scheduling.optionType", "global")
itemBody, _ = sjson.Set(itemBody, "scheduling.value", item.SchedulingType.ValueString())
}
}
body, _ = sjson.SetRaw(body, path+"qosMap.qosSchedulers.-1", itemBody)
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString())
}
} else if !data.InterfaceName.IsNull() {
body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global")
body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString())
if true {
body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global")
body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString())
}
}

if !data.InterfaceDescriptionVariable.IsNull() {
Expand All @@ -112,8 +114,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {

}
} else {
body, _ = sjson.Set(body, path+"basic.description.optionType", "global")
body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString())
if true {
body, _ = sjson.Set(body, path+"basic.description.optionType", "global")
body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString())
}
}

if !data.Ipv4AddressVariable.IsNull() {
Expand All @@ -122,8 +126,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString())
}
} else if !data.Ipv4Address.IsNull() {
body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global")
body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString())
if true {
body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global")
body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString())
}
}

if !data.Ipv4SubnetMaskVariable.IsNull() {
Expand All @@ -132,8 +138,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
}
} else if !data.Ipv4SubnetMask.IsNull() {
body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global")
body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString())
if true {
body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global")
body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString())
}
}

if !data.ShutdownVariable.IsNull() {
Expand All @@ -147,8 +155,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.shutdown.value", false)
}
} else {
body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global")
body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool())
if true {
body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global")
body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool())
}
}

if !data.TunnelSourceIpv4AddressVariable.IsNull() {
Expand All @@ -157,8 +167,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString())
}
} else if !data.TunnelSourceIpv4Address.IsNull() {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString())
if true {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString())
}
}

if !data.TunnelSourceInterfaceVariable.IsNull() {
Expand All @@ -167,8 +179,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString())
}
} else if !data.TunnelSourceInterface.IsNull() {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
if true {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
}
}

if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() {
Expand All @@ -177,8 +191,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString())
}
} else if !data.TunnelSourceInterfaceLoopback.IsNull() {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString())
if true {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString())
}
}

if !data.TunnelRouteViaLoopbackVariable.IsNull() {
Expand All @@ -187,8 +203,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString())
}
} else if !data.TunnelRouteViaLoopback.IsNull() {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString())
if true {
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString())
}
}

if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
Expand All @@ -197,8 +215,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString())
}
} else if !data.TunnelDestinationIpv4Address.IsNull() {
body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString())
if true {
body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString())
}
}

if !data.IpMtuVariable.IsNull() {
Expand All @@ -212,8 +232,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.mtu.value", 1500)
}
} else {
body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global")
body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64())
if true {
body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global")
body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64())
}
}

if !data.TcpMssVariable.IsNull() {
Expand All @@ -227,8 +249,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {

}
} else {
body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64())
if true {
body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global")
body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64())
}
}

if !data.ClearDontFragmentVariable.IsNull() {
Expand All @@ -242,8 +266,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false)
}
} else {
body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global")
body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool())
if true {
body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global")
body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool())
}
}

if !data.ApplicationTunnelTypeVariable.IsNull() {
Expand All @@ -252,8 +278,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString())
}
} else if !data.ApplicationTunnelType.IsNull() {
body, _ = sjson.Set(body, path+"advanced.application.optionType", "global")
body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString())
if true {
body, _ = sjson.Set(body, path+"advanced.application.optionType", "global")
body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString())
}
}
return body
}
Expand Down
Loading

0 comments on commit 42ac6da

Please sign in to comment.