@@ -1556,7 +1556,6 @@ func (data ServiceRoutingBGP) toBody(ctx context.Context) string {
1556
1556
1557
1557
// End of section. //template:end toBody
1558
1558
1559
- // Section below is generated&owned by "gen/generator.go". //template:begin fromBody
1560
1559
func (data * ServiceRoutingBGP ) fromBody (ctx context.Context , res gjson.Result ) {
1561
1560
data .Name = types .StringValue (res .Get ("payload.name" ).String ())
1562
1561
if value := res .Get ("payload.description" ); value .Exists () && value .String () != "" {
@@ -1881,80 +1880,94 @@ func (data *ServiceRoutingBGP) fromBody(ctx context.Context, res gjson.Result) {
1881
1880
}
1882
1881
cItem .RestartMaxNumberOfPrefixes = types .Int64Null ()
1883
1882
cItem .RestartMaxNumberOfPrefixesVariable = types .StringNull ()
1884
- if t := cv .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
1885
- va := cv .Get ("maxPrefixConfig.prefixNum.value" )
1886
- if t .String () == "variable" {
1887
- cItem .RestartMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
1888
- } else if t .String () == "global" {
1889
- cItem .RestartMaxNumberOfPrefixes = types .Int64Value (va .Int ())
1883
+ if true && cItem .PolicyType .ValueString () == "restart" {
1884
+ if t := cv .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
1885
+ va := cv .Get ("maxPrefixConfig.prefixNum.value" )
1886
+ if t .String () == "variable" {
1887
+ cItem .RestartMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
1888
+ } else if t .String () == "global" {
1889
+ cItem .RestartMaxNumberOfPrefixes = types .Int64Value (va .Int ())
1890
+ }
1891
+ cItem .PolicyType = types .StringValue ("restart" )
1890
1892
}
1891
- cItem .PolicyType = types .StringValue ("restart" )
1892
1893
}
1893
1894
cItem .RestartThreshold = types .Int64Null ()
1894
1895
cItem .RestartThresholdVariable = types .StringNull ()
1895
- if t := cv .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
1896
- va := cv .Get ("maxPrefixConfig.threshold.value" )
1897
- if t .String () == "variable" {
1898
- cItem .RestartThresholdVariable = types .StringValue (va .String ())
1899
- } else if t .String () == "global" {
1900
- cItem .RestartThreshold = types .Int64Value (va .Int ())
1896
+ if true && cItem .PolicyType .ValueString () == "restart" {
1897
+ if t := cv .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
1898
+ va := cv .Get ("maxPrefixConfig.threshold.value" )
1899
+ if t .String () == "variable" {
1900
+ cItem .RestartThresholdVariable = types .StringValue (va .String ())
1901
+ } else if t .String () == "global" {
1902
+ cItem .RestartThreshold = types .Int64Value (va .Int ())
1903
+ }
1904
+ cItem .PolicyType = types .StringValue ("restart" )
1901
1905
}
1902
- cItem .PolicyType = types .StringValue ("restart" )
1903
1906
}
1904
1907
cItem .RestartInterval = types .Int64Null ()
1905
1908
cItem .RestartIntervalVariable = types .StringNull ()
1906
- if t := cv .Get ("maxPrefixConfig.restartInterval.optionType" ); t .Exists () {
1907
- va := cv .Get ("maxPrefixConfig.restartInterval.value" )
1908
- if t .String () == "variable" {
1909
- cItem .RestartIntervalVariable = types .StringValue (va .String ())
1910
- } else if t .String () == "global" {
1911
- cItem .RestartInterval = types .Int64Value (va .Int ())
1909
+ if true && cItem .PolicyType .ValueString () == "restart" {
1910
+ if t := cv .Get ("maxPrefixConfig.restartInterval.optionType" ); t .Exists () {
1911
+ va := cv .Get ("maxPrefixConfig.restartInterval.value" )
1912
+ if t .String () == "variable" {
1913
+ cItem .RestartIntervalVariable = types .StringValue (va .String ())
1914
+ } else if t .String () == "global" {
1915
+ cItem .RestartInterval = types .Int64Value (va .Int ())
1916
+ }
1917
+ cItem .PolicyType = types .StringValue ("restart" )
1912
1918
}
1913
- cItem .PolicyType = types .StringValue ("restart" )
1914
1919
}
1915
1920
cItem .WarningMessageMaxNumberOfPrefixes = types .Int64Null ()
1916
1921
cItem .WarningMessageMaxNumberOfPrefixesVariable = types .StringNull ()
1917
- if t := cv .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
1918
- va := cv .Get ("maxPrefixConfig.prefixNum.value" )
1919
- if t .String () == "variable" {
1920
- cItem .WarningMessageMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
1921
- } else if t .String () == "global" {
1922
- cItem .WarningMessageMaxNumberOfPrefixes = types .Int64Value (va .Int ())
1922
+ if true && cItem .PolicyType .ValueString () == "warning-only" {
1923
+ if t := cv .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
1924
+ va := cv .Get ("maxPrefixConfig.prefixNum.value" )
1925
+ if t .String () == "variable" {
1926
+ cItem .WarningMessageMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
1927
+ } else if t .String () == "global" {
1928
+ cItem .WarningMessageMaxNumberOfPrefixes = types .Int64Value (va .Int ())
1929
+ }
1930
+ cItem .PolicyType = types .StringValue ("warning-only" )
1923
1931
}
1924
- cItem .PolicyType = types .StringValue ("warning-only" )
1925
1932
}
1926
1933
cItem .WarningMessageThreshold = types .Int64Null ()
1927
1934
cItem .WarningMessageThresholdVariable = types .StringNull ()
1928
- if t := cv .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
1929
- va := cv .Get ("maxPrefixConfig.threshold.value" )
1930
- if t .String () == "variable" {
1931
- cItem .WarningMessageThresholdVariable = types .StringValue (va .String ())
1932
- } else if t .String () == "global" {
1933
- cItem .WarningMessageThreshold = types .Int64Value (va .Int ())
1935
+ if true && cItem .PolicyType .ValueString () == "warning-only" {
1936
+ if t := cv .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
1937
+ va := cv .Get ("maxPrefixConfig.threshold.value" )
1938
+ if t .String () == "variable" {
1939
+ cItem .WarningMessageThresholdVariable = types .StringValue (va .String ())
1940
+ } else if t .String () == "global" {
1941
+ cItem .WarningMessageThreshold = types .Int64Value (va .Int ())
1942
+ }
1943
+ cItem .PolicyType = types .StringValue ("warning-only" )
1934
1944
}
1935
- cItem .PolicyType = types .StringValue ("warning-only" )
1936
1945
}
1937
1946
cItem .DisablePeerMaxNumberOfPrefixes = types .Int64Null ()
1938
1947
cItem .DisablePeerMaxNumberOfPrefixesVariable = types .StringNull ()
1939
- if t := cv .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
1940
- va := cv .Get ("maxPrefixConfig.prefixNum.value" )
1941
- if t .String () == "variable" {
1942
- cItem .DisablePeerMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
1943
- } else if t .String () == "global" {
1944
- cItem .DisablePeerMaxNumberOfPrefixes = types .Int64Value (va .Int ())
1948
+ if true && cItem .PolicyType .ValueString () == "disable-peer" {
1949
+ if t := cv .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
1950
+ va := cv .Get ("maxPrefixConfig.prefixNum.value" )
1951
+ if t .String () == "variable" {
1952
+ cItem .DisablePeerMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
1953
+ } else if t .String () == "global" {
1954
+ cItem .DisablePeerMaxNumberOfPrefixes = types .Int64Value (va .Int ())
1955
+ }
1956
+ cItem .PolicyType = types .StringValue ("disable-peer" )
1945
1957
}
1946
- cItem .PolicyType = types .StringValue ("disable-peer" )
1947
1958
}
1948
1959
cItem .DisablePeerThreshold = types .Int64Null ()
1949
1960
cItem .DisablePeerThresholdVariable = types .StringNull ()
1950
- if t := cv .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
1951
- va := cv .Get ("maxPrefixConfig.threshold.value" )
1952
- if t .String () == "variable" {
1953
- cItem .DisablePeerThresholdVariable = types .StringValue (va .String ())
1954
- } else if t .String () == "global" {
1955
- cItem .DisablePeerThreshold = types .Int64Value (va .Int ())
1961
+ if true && cItem .PolicyType .ValueString () == "disable-peer" {
1962
+ if t := cv .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
1963
+ va := cv .Get ("maxPrefixConfig.threshold.value" )
1964
+ if t .String () == "variable" {
1965
+ cItem .DisablePeerThresholdVariable = types .StringValue (va .String ())
1966
+ } else if t .String () == "global" {
1967
+ cItem .DisablePeerThreshold = types .Int64Value (va .Int ())
1968
+ }
1969
+ cItem .PolicyType = types .StringValue ("disable-peer" )
1956
1970
}
1957
- cItem .PolicyType = types .StringValue ("disable-peer" )
1958
1971
}
1959
1972
cItem .InRoutePolicyId = types .StringNull ()
1960
1973
@@ -2460,9 +2473,6 @@ func (data *ServiceRoutingBGP) fromBody(ctx context.Context, res gjson.Result) {
2460
2473
}
2461
2474
}
2462
2475
2463
- // End of section. //template:end fromBody
2464
-
2465
- // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
2466
2476
func (data * ServiceRoutingBGP ) updateFromBody (ctx context.Context , res gjson.Result ) {
2467
2477
data .Name = types .StringValue (res .Get ("payload.name" ).String ())
2468
2478
if value := res .Get ("payload.description" ); value .Exists () && value .String () != "" {
@@ -2841,72 +2851,86 @@ func (data *ServiceRoutingBGP) updateFromBody(ctx context.Context, res gjson.Res
2841
2851
}
2842
2852
data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartMaxNumberOfPrefixes = types .Int64Null ()
2843
2853
data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartMaxNumberOfPrefixesVariable = types .StringNull ()
2844
- if t := cr .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
2845
- va := cr .Get ("maxPrefixConfig.prefixNum.value" )
2846
- if t .String () == "variable" {
2847
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
2848
- } else if t .String () == "global" {
2849
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartMaxNumberOfPrefixes = types .Int64Value (va .Int ())
2854
+ if true && data .Ipv4Neighbors [i ].AddressFamilies [ci ].PolicyType .ValueString () == "restart" {
2855
+ if t := cr .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
2856
+ va := cr .Get ("maxPrefixConfig.prefixNum.value" )
2857
+ if t .String () == "variable" {
2858
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
2859
+ } else if t .String () == "global" {
2860
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartMaxNumberOfPrefixes = types .Int64Value (va .Int ())
2861
+ }
2850
2862
}
2851
2863
}
2852
2864
data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartThreshold = types .Int64Null ()
2853
2865
data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartThresholdVariable = types .StringNull ()
2854
- if t := cr .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
2855
- va := cr .Get ("maxPrefixConfig.threshold.value" )
2856
- if t .String () == "variable" {
2857
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartThresholdVariable = types .StringValue (va .String ())
2858
- } else if t .String () == "global" {
2859
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartThreshold = types .Int64Value (va .Int ())
2866
+ if true && data .Ipv4Neighbors [i ].AddressFamilies [ci ].PolicyType .ValueString () == "restart" {
2867
+ if t := cr .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
2868
+ va := cr .Get ("maxPrefixConfig.threshold.value" )
2869
+ if t .String () == "variable" {
2870
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartThresholdVariable = types .StringValue (va .String ())
2871
+ } else if t .String () == "global" {
2872
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartThreshold = types .Int64Value (va .Int ())
2873
+ }
2860
2874
}
2861
2875
}
2862
2876
data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartInterval = types .Int64Null ()
2863
2877
data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartIntervalVariable = types .StringNull ()
2864
- if t := cr .Get ("maxPrefixConfig.restartInterval.optionType" ); t .Exists () {
2865
- va := cr .Get ("maxPrefixConfig.restartInterval.value" )
2866
- if t .String () == "variable" {
2867
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartIntervalVariable = types .StringValue (va .String ())
2868
- } else if t .String () == "global" {
2869
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartInterval = types .Int64Value (va .Int ())
2878
+ if true && data .Ipv4Neighbors [i ].AddressFamilies [ci ].PolicyType .ValueString () == "restart" {
2879
+ if t := cr .Get ("maxPrefixConfig.restartInterval.optionType" ); t .Exists () {
2880
+ va := cr .Get ("maxPrefixConfig.restartInterval.value" )
2881
+ if t .String () == "variable" {
2882
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartIntervalVariable = types .StringValue (va .String ())
2883
+ } else if t .String () == "global" {
2884
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].RestartInterval = types .Int64Value (va .Int ())
2885
+ }
2870
2886
}
2871
2887
}
2872
2888
data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageMaxNumberOfPrefixes = types .Int64Null ()
2873
2889
data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageMaxNumberOfPrefixesVariable = types .StringNull ()
2874
- if t := cr .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
2875
- va := cr .Get ("maxPrefixConfig.prefixNum.value" )
2876
- if t .String () == "variable" {
2877
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
2878
- } else if t .String () == "global" {
2879
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageMaxNumberOfPrefixes = types .Int64Value (va .Int ())
2890
+ if true && data .Ipv4Neighbors [i ].AddressFamilies [ci ].PolicyType .ValueString () == "warning-only" {
2891
+ if t := cr .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
2892
+ va := cr .Get ("maxPrefixConfig.prefixNum.value" )
2893
+ if t .String () == "variable" {
2894
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
2895
+ } else if t .String () == "global" {
2896
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageMaxNumberOfPrefixes = types .Int64Value (va .Int ())
2897
+ }
2880
2898
}
2881
2899
}
2882
2900
data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageThreshold = types .Int64Null ()
2883
2901
data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageThresholdVariable = types .StringNull ()
2884
- if t := cr .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
2885
- va := cr .Get ("maxPrefixConfig.threshold.value" )
2886
- if t .String () == "variable" {
2887
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageThresholdVariable = types .StringValue (va .String ())
2888
- } else if t .String () == "global" {
2889
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageThreshold = types .Int64Value (va .Int ())
2902
+ if true && data .Ipv4Neighbors [i ].AddressFamilies [ci ].PolicyType .ValueString () == "warning-only" {
2903
+ if t := cr .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
2904
+ va := cr .Get ("maxPrefixConfig.threshold.value" )
2905
+ if t .String () == "variable" {
2906
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageThresholdVariable = types .StringValue (va .String ())
2907
+ } else if t .String () == "global" {
2908
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].WarningMessageThreshold = types .Int64Value (va .Int ())
2909
+ }
2890
2910
}
2891
2911
}
2892
2912
data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerMaxNumberOfPrefixes = types .Int64Null ()
2893
2913
data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerMaxNumberOfPrefixesVariable = types .StringNull ()
2894
- if t := cr .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
2895
- va := cr .Get ("maxPrefixConfig.prefixNum.value" )
2896
- if t .String () == "variable" {
2897
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
2898
- } else if t .String () == "global" {
2899
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerMaxNumberOfPrefixes = types .Int64Value (va .Int ())
2914
+ if true && data .Ipv4Neighbors [i ].AddressFamilies [ci ].PolicyType .ValueString () == "disable-peer" {
2915
+ if t := cr .Get ("maxPrefixConfig.prefixNum.optionType" ); t .Exists () {
2916
+ va := cr .Get ("maxPrefixConfig.prefixNum.value" )
2917
+ if t .String () == "variable" {
2918
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerMaxNumberOfPrefixesVariable = types .StringValue (va .String ())
2919
+ } else if t .String () == "global" {
2920
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerMaxNumberOfPrefixes = types .Int64Value (va .Int ())
2921
+ }
2900
2922
}
2901
2923
}
2902
2924
data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerThreshold = types .Int64Null ()
2903
2925
data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerThresholdVariable = types .StringNull ()
2904
- if t := cr .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
2905
- va := cr .Get ("maxPrefixConfig.threshold.value" )
2906
- if t .String () == "variable" {
2907
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerThresholdVariable = types .StringValue (va .String ())
2908
- } else if t .String () == "global" {
2909
- data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerThreshold = types .Int64Value (va .Int ())
2926
+ if true && data .Ipv4Neighbors [i ].AddressFamilies [ci ].PolicyType .ValueString () == "disable-peer" {
2927
+ if t := cr .Get ("maxPrefixConfig.threshold.optionType" ); t .Exists () {
2928
+ va := cr .Get ("maxPrefixConfig.threshold.value" )
2929
+ if t .String () == "variable" {
2930
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerThresholdVariable = types .StringValue (va .String ())
2931
+ } else if t .String () == "global" {
2932
+ data .Ipv4Neighbors [i ].AddressFamilies [ci ].DisablePeerThreshold = types .Int64Value (va .Int ())
2933
+ }
2910
2934
}
2911
2935
}
2912
2936
data .Ipv4Neighbors [i ].AddressFamilies [ci ].InRoutePolicyId = types .StringNull ()
@@ -3598,5 +3622,3 @@ func (data *ServiceRoutingBGP) updateFromBody(ctx context.Context, res gjson.Res
3598
3622
}
3599
3623
}
3600
3624
}
3601
-
3602
- // End of section. //template:end updateFromBody
0 commit comments