From 28fb1fe90e0ef5807f30f408001476423891e146 Mon Sep 17 00:00:00 2001 From: huyujie Date: Fri, 31 May 2019 16:48:05 +0800 Subject: [PATCH] fix-incorrect-vxnet_type-content --- service/nic.go | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/service/nic.go b/service/nic.go index fe2f11c..712de83 100644 --- a/service/nic.go +++ b/service/nic.go @@ -238,9 +238,8 @@ type DescribeNicsInput struct { Offset *int `json:"offset" name:"offset" default:"0" location:"params"` Owner *string `json:"owner" name:"owner" location:"params"` // Status's available values: available, in-use - Status *string `json:"status" name:"status" location:"params"` - // VxNetType's available values: 0, 1 - VxNetType *int `json:"vxnet_type" name:"vxnet_type" location:"params"` + Status *string `json:"status" name:"status" location:"params"` + VxNetType []*int `json:"vxnet_type" name:"vxnet_type" location:"params"` VxNets []*string `json:"vxnets" name:"vxnets" location:"params"` } @@ -266,26 +265,6 @@ func (v *DescribeNicsInput) Validate() error { } } - if v.VxNetType != nil { - vxnetTypeValidValues := []string{"0", "1"} - vxnetTypeParameterValue := fmt.Sprint(*v.VxNetType) - - vxnetTypeIsValid := false - for _, value := range vxnetTypeValidValues { - if value == vxnetTypeParameterValue { - vxnetTypeIsValid = true - } - } - - if !vxnetTypeIsValid { - return errors.ParameterValueNotAllowedError{ - ParameterName: "VxNetType", - ParameterValue: vxnetTypeParameterValue, - AllowedValues: vxnetTypeValidValues, - } - } - } - return nil }