github.com/cloudwan/edgelq-sdk@v1.15.4/limits/resources/v1alpha2/plan_assignment_request/plan_assignment_request.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/limits/proto/v1alpha2/plan_assignment_request.proto 3 // DO NOT EDIT!!! 4 5 package plan_assignment_request 6 7 import ( 8 "bytes" 9 "errors" 10 "fmt" 11 "net" 12 "net/url" 13 "regexp" 14 "strings" 15 "time" 16 "unicode/utf8" 17 18 gotenvalidate "github.com/cloudwan/goten-sdk/runtime/validate" 19 ) 20 21 // proto imports 22 import ( 23 iam_organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/organization" 24 iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/project" 25 common "github.com/cloudwan/edgelq-sdk/limits/resources/v1alpha2/common" 26 plan "github.com/cloudwan/edgelq-sdk/limits/resources/v1alpha2/plan" 27 plan_assignment "github.com/cloudwan/edgelq-sdk/limits/resources/v1alpha2/plan_assignment" 28 meta_service "github.com/cloudwan/edgelq-sdk/meta/resources/v1alpha2/service" 29 meta "github.com/cloudwan/goten-sdk/types/meta" 30 ) 31 32 var ( 33 _ = bytes.Equal 34 _ = errors.New 35 _ = fmt.Errorf 36 _ = net.ParseIP 37 _ = regexp.Match 38 _ = strings.Split 39 _ = time.Now 40 _ = utf8.RuneCountInString 41 _ = url.Parse 42 _ = gotenvalidate.NewValidationError 43 ) 44 45 // make sure we're using proto imports 46 var ( 47 _ = &iam_organization.Organization{} 48 _ = &iam_project.Project{} 49 _ = &common.Allowance{} 50 _ = &plan.Plan{} 51 _ = &plan_assignment.PlanAssignment{} 52 _ = &meta_service.Service{} 53 _ = &meta.Meta{} 54 ) 55 56 func (obj *PlanAssignmentRequest) GotenValidate() error { 57 if obj == nil { 58 return nil 59 } 60 if subobj, ok := interface{}(obj.Request).(gotenvalidate.Validator); ok { 61 if err := subobj.GotenValidate(); err != nil { 62 return gotenvalidate.NewValidationError("PlanAssignmentRequest", "request", obj.Request, "nested object validation failed", err) 63 } 64 } 65 if subobj, ok := interface{}(obj.Status).(gotenvalidate.Validator); ok { 66 if err := subobj.GotenValidate(); err != nil { 67 return gotenvalidate.NewValidationError("PlanAssignmentRequest", "status", obj.Status, "nested object validation failed", err) 68 } 69 } 70 if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok { 71 if err := subobj.GotenValidate(); err != nil { 72 return gotenvalidate.NewValidationError("PlanAssignmentRequest", "metadata", obj.Metadata, "nested object validation failed", err) 73 } 74 } 75 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 76 return cvobj.GotenCustomValidate() 77 } 78 return nil 79 } 80 func (obj *PlanAssignmentRequest_Status) GotenValidate() error { 81 if obj == nil { 82 return nil 83 } 84 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 85 return cvobj.GotenCustomValidate() 86 } 87 return nil 88 } 89 func (obj *PlanAssignmentRequest_RequestType) GotenValidate() error { 90 if obj == nil { 91 return nil 92 } 93 switch opt := obj.Request.(type) { 94 case *PlanAssignmentRequest_RequestType_Assign_: 95 if subobj, ok := interface{}(opt.Assign).(gotenvalidate.Validator); ok { 96 if err := subobj.GotenValidate(); err != nil { 97 return gotenvalidate.NewValidationError("RequestType", "assign", opt.Assign, "nested object validation failed", err) 98 } 99 } 100 case *PlanAssignmentRequest_RequestType_Extend_: 101 if subobj, ok := interface{}(opt.Extend).(gotenvalidate.Validator); ok { 102 if err := subobj.GotenValidate(); err != nil { 103 return gotenvalidate.NewValidationError("RequestType", "extend", opt.Extend, "nested object validation failed", err) 104 } 105 } 106 case *PlanAssignmentRequest_RequestType_Redistribute_: 107 if subobj, ok := interface{}(opt.Redistribute).(gotenvalidate.Validator); ok { 108 if err := subobj.GotenValidate(); err != nil { 109 return gotenvalidate.NewValidationError("RequestType", "redistribute", opt.Redistribute, "nested object validation failed", err) 110 } 111 } 112 case *PlanAssignmentRequest_RequestType_Unassign_: 113 if subobj, ok := interface{}(opt.Unassign).(gotenvalidate.Validator); ok { 114 if err := subobj.GotenValidate(); err != nil { 115 return gotenvalidate.NewValidationError("RequestType", "unassign", opt.Unassign, "nested object validation failed", err) 116 } 117 } 118 default: 119 _ = opt 120 } 121 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 122 return cvobj.GotenCustomValidate() 123 } 124 return nil 125 } 126 func (obj *PlanAssignmentRequest_RequestType_Assign) GotenValidate() error { 127 if obj == nil { 128 return nil 129 } 130 for idx, elem := range obj.Extensions { 131 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 132 if err := subobj.GotenValidate(); err != nil { 133 return gotenvalidate.NewValidationError("Assign", "extensions", obj.Extensions[idx], "nested object validation failed", err) 134 } 135 } 136 } 137 for idx, elem := range obj.RegionalDistributions { 138 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 139 if err := subobj.GotenValidate(); err != nil { 140 return gotenvalidate.NewValidationError("Assign", "regionalDistributions", obj.RegionalDistributions[idx], "nested object validation failed", err) 141 } 142 } 143 } 144 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 145 return cvobj.GotenCustomValidate() 146 } 147 return nil 148 } 149 func (obj *PlanAssignmentRequest_RequestType_Extend) GotenValidate() error { 150 if obj == nil { 151 return nil 152 } 153 for idx, elem := range obj.Additions { 154 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 155 if err := subobj.GotenValidate(); err != nil { 156 return gotenvalidate.NewValidationError("Extend", "additions", obj.Additions[idx], "nested object validation failed", err) 157 } 158 } 159 } 160 for idx, elem := range obj.RegionalDistributions { 161 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 162 if err := subobj.GotenValidate(); err != nil { 163 return gotenvalidate.NewValidationError("Extend", "regionalDistributions", obj.RegionalDistributions[idx], "nested object validation failed", err) 164 } 165 } 166 } 167 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 168 return cvobj.GotenCustomValidate() 169 } 170 return nil 171 } 172 func (obj *PlanAssignmentRequest_RequestType_Redistribute) GotenValidate() error { 173 if obj == nil { 174 return nil 175 } 176 for idx, elem := range obj.RegionalDistributions { 177 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 178 if err := subobj.GotenValidate(); err != nil { 179 return gotenvalidate.NewValidationError("Redistribute", "regionalDistributions", obj.RegionalDistributions[idx], "nested object validation failed", err) 180 } 181 } 182 } 183 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 184 return cvobj.GotenCustomValidate() 185 } 186 return nil 187 } 188 func (obj *PlanAssignmentRequest_RequestType_Unassign) GotenValidate() error { 189 if obj == nil { 190 return nil 191 } 192 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 193 return cvobj.GotenCustomValidate() 194 } 195 return nil 196 }