github.com/cloudwan/edgelq-sdk@v1.15.4/limits/resources/v1/accepted_plan/accepted_plan_change.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/limits/proto/v1/accepted_plan_change.proto 3 // DO NOT EDIT!!! 4 5 package accepted_plan 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/v1/organization" 24 meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service" 25 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 26 ) 27 28 var ( 29 _ = bytes.Equal 30 _ = errors.New 31 _ = fmt.Errorf 32 _ = net.ParseIP 33 _ = regexp.Match 34 _ = strings.Split 35 _ = time.Now 36 _ = utf8.RuneCountInString 37 _ = url.Parse 38 _ = gotenvalidate.NewValidationError 39 ) 40 41 // make sure we're using proto imports 42 var ( 43 _ = &iam_organization.Organization{} 44 _ = &fieldmaskpb.FieldMask{} 45 _ = &meta_service.Service{} 46 ) 47 48 func (obj *AcceptedPlanChange) GotenValidate() error { 49 if obj == nil { 50 return nil 51 } 52 switch opt := obj.ChangeType.(type) { 53 case *AcceptedPlanChange_Added_: 54 if subobj, ok := interface{}(opt.Added).(gotenvalidate.Validator); ok { 55 if err := subobj.GotenValidate(); err != nil { 56 return gotenvalidate.NewValidationError("AcceptedPlanChange", "added", opt.Added, "nested object validation failed", err) 57 } 58 } 59 case *AcceptedPlanChange_Modified_: 60 if subobj, ok := interface{}(opt.Modified).(gotenvalidate.Validator); ok { 61 if err := subobj.GotenValidate(); err != nil { 62 return gotenvalidate.NewValidationError("AcceptedPlanChange", "modified", opt.Modified, "nested object validation failed", err) 63 } 64 } 65 case *AcceptedPlanChange_Current_: 66 if subobj, ok := interface{}(opt.Current).(gotenvalidate.Validator); ok { 67 if err := subobj.GotenValidate(); err != nil { 68 return gotenvalidate.NewValidationError("AcceptedPlanChange", "current", opt.Current, "nested object validation failed", err) 69 } 70 } 71 case *AcceptedPlanChange_Removed_: 72 if subobj, ok := interface{}(opt.Removed).(gotenvalidate.Validator); ok { 73 if err := subobj.GotenValidate(); err != nil { 74 return gotenvalidate.NewValidationError("AcceptedPlanChange", "removed", opt.Removed, "nested object validation failed", err) 75 } 76 } 77 default: 78 _ = opt 79 } 80 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 81 return cvobj.GotenCustomValidate() 82 } 83 return nil 84 } 85 func (obj *AcceptedPlanChange_Added) GotenValidate() error { 86 if obj == nil { 87 return nil 88 } 89 if subobj, ok := interface{}(obj.AcceptedPlan).(gotenvalidate.Validator); ok { 90 if err := subobj.GotenValidate(); err != nil { 91 return gotenvalidate.NewValidationError("Added", "acceptedPlan", obj.AcceptedPlan, "nested object validation failed", err) 92 } 93 } 94 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 95 return cvobj.GotenCustomValidate() 96 } 97 return nil 98 } 99 func (obj *AcceptedPlanChange_Modified) GotenValidate() error { 100 if obj == nil { 101 return nil 102 } 103 if subobj, ok := interface{}(obj.AcceptedPlan).(gotenvalidate.Validator); ok { 104 if err := subobj.GotenValidate(); err != nil { 105 return gotenvalidate.NewValidationError("Modified", "acceptedPlan", obj.AcceptedPlan, "nested object validation failed", err) 106 } 107 } 108 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 109 return cvobj.GotenCustomValidate() 110 } 111 return nil 112 } 113 func (obj *AcceptedPlanChange_Current) GotenValidate() error { 114 if obj == nil { 115 return nil 116 } 117 if subobj, ok := interface{}(obj.AcceptedPlan).(gotenvalidate.Validator); ok { 118 if err := subobj.GotenValidate(); err != nil { 119 return gotenvalidate.NewValidationError("Current", "acceptedPlan", obj.AcceptedPlan, "nested object validation failed", err) 120 } 121 } 122 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 123 return cvobj.GotenCustomValidate() 124 } 125 return nil 126 } 127 func (obj *AcceptedPlanChange_Removed) GotenValidate() error { 128 if obj == nil { 129 return nil 130 } 131 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 132 return cvobj.GotenCustomValidate() 133 } 134 return nil 135 }