diff --git a/services/iaas/model_allowed_addresses_inner.go b/services/iaas/model_allowed_addresses_inner.go index 02e6f4d8d..4646647e7 100644 --- a/services/iaas/model_allowed_addresses_inner.go +++ b/services/iaas/model_allowed_addresses_inner.go @@ -39,13 +39,13 @@ func (dst *AllowedAddressesInner) UnmarshalJSON(data []byte) error { dstAllowedAddressesInner1 := &AllowedAddressesInner{} err = json.Unmarshal(data, &dstAllowedAddressesInner1.String) if err == nil { - jsonstring, _ := json.Marshal(&dstAllowedAddressesInner1.String) + jsonString, _ := json.Marshal(&dstAllowedAddressesInner1.String) regex := `/((^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$)|(^\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$))/` regex = regexp.MustCompile("^\\/|\\/$").ReplaceAllString(regex, "$1") // Remove beginning slash and ending slash regex = regexp.MustCompile("\\\\(.)").ReplaceAllString(regex, "$1") // Remove duplicate escaping char for dots rawString := regexp.MustCompile(`^"|"$`).ReplaceAllString(*dstAllowedAddressesInner1.String, "$1") // Remove quotes isMatched, _ := regexp.MatchString(regex, rawString) - if string(jsonstring) != "{}" && isMatched { // empty struct + if string(jsonString) != "{}" && isMatched { // empty struct dst.String = dstAllowedAddressesInner1.String match++ } @@ -55,13 +55,13 @@ func (dst *AllowedAddressesInner) UnmarshalJSON(data []byte) error { dstAllowedAddressesInner2 := &AllowedAddressesInner{} err = json.Unmarshal(data, &dstAllowedAddressesInner2.String) if err == nil { - jsonstring, _ := json.Marshal(&dstAllowedAddressesInner2.String) + jsonString, _ := json.Marshal(&dstAllowedAddressesInner2.String) regex := `/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$/` regex = regexp.MustCompile("^\\/|\\/$").ReplaceAllString(regex, "$1") // Remove beginning slash and ending slash regex = regexp.MustCompile("\\\\(.)").ReplaceAllString(regex, "$1") // Remove duplicate escaping char for dots rawString := regexp.MustCompile(`^"|"$`).ReplaceAllString(*dstAllowedAddressesInner2.String, "$1") // Remove quotes isMatched, _ := regexp.MatchString(regex, rawString) - if string(jsonstring) != "{}" && isMatched { // empty struct + if string(jsonString) != "{}" && isMatched { // empty struct dst.String = dstAllowedAddressesInner2.String match++ } diff --git a/services/iaas/model_area_id.go b/services/iaas/model_area_id.go index ec835bf97..4385d85e6 100644 --- a/services/iaas/model_area_id.go +++ b/services/iaas/model_area_id.go @@ -47,13 +47,13 @@ func (dst *AreaId) UnmarshalJSON(data []byte) error { dstAreaId1 := &AreaId{} err = json.Unmarshal(data, &dstAreaId1.String) if err == nil { - jsonstring, _ := json.Marshal(&dstAreaId1.String) + jsonString, _ := json.Marshal(&dstAreaId1.String) regex := `/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/` regex = regexp.MustCompile("^\\/|\\/$").ReplaceAllString(regex, "$1") // Remove beginning slash and ending slash regex = regexp.MustCompile("\\\\(.)").ReplaceAllString(regex, "$1") // Remove duplicate escaping char for dots rawString := regexp.MustCompile(`^"|"$`).ReplaceAllString(*dstAreaId1.String, "$1") // Remove quotes isMatched, _ := regexp.MatchString(regex, rawString) - if string(jsonstring) != "{}" && isMatched { // empty struct + if string(jsonString) != "{}" && isMatched { // empty struct dst.String = dstAreaId1.String match++ } diff --git a/services/iaas/model_create_protocol.go b/services/iaas/model_create_protocol.go index e5d06c3a5..6b7cd6370 100644 --- a/services/iaas/model_create_protocol.go +++ b/services/iaas/model_create_protocol.go @@ -46,8 +46,8 @@ func (dst *CreateProtocol) UnmarshalJSON(data []byte) error { dstCreateProtocol1 := &CreateProtocol{} err = json.Unmarshal(data, &dstCreateProtocol1.Int64) if err == nil { - jsonint64, _ := json.Marshal(&dstCreateProtocol1.Int64) - if string(jsonint64) != "{}" { // empty struct + jsonInt64, _ := json.Marshal(&dstCreateProtocol1.Int64) + if string(jsonInt64) != "{}" { // empty struct dst.Int64 = dstCreateProtocol1.Int64 match++ } @@ -57,8 +57,8 @@ func (dst *CreateProtocol) UnmarshalJSON(data []byte) error { dstCreateProtocol2 := &CreateProtocol{} err = json.Unmarshal(data, &dstCreateProtocol2.String) if err == nil { - jsonstring, _ := json.Marshal(&dstCreateProtocol2.String) - if string(jsonstring) != "{}" { // empty struct + jsonString, _ := json.Marshal(&dstCreateProtocol2.String) + if string(jsonString) != "{}" { // empty struct dst.String = dstCreateProtocol2.String match++ }