github.com/cloudwan/edgelq-sdk@v1.15.4/limits/resources/v1/plan_assignment/plan_assignment.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/limits/proto/v1/plan_assignment.proto 3 // DO NOT EDIT!!! 4 5 package plan_assignment 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 iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project" 25 accepted_plan "github.com/cloudwan/edgelq-sdk/limits/resources/v1/accepted_plan" 26 common "github.com/cloudwan/edgelq-sdk/limits/resources/v1/common" 27 plan "github.com/cloudwan/edgelq-sdk/limits/resources/v1/plan" 28 meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/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 _ = &accepted_plan.AcceptedPlan{} 50 _ = &common.RegionalPlanAssignment{} 51 _ = &plan.Plan{} 52 _ = &meta_service.Service{} 53 _ = &meta.Meta{} 54 ) 55 56 func (obj *PlanAssignment) GotenValidate() error { 57 if obj == nil { 58 return nil 59 } 60 if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok { 61 if err := subobj.GotenValidate(); err != nil { 62 return gotenvalidate.NewValidationError("PlanAssignment", "metadata", obj.Metadata, "nested object validation failed", err) 63 } 64 } 65 for idx, elem := range obj.RegionalPlanOverrides { 66 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 67 if err := subobj.GotenValidate(); err != nil { 68 return gotenvalidate.NewValidationError("PlanAssignment", "regionalPlanOverrides", obj.RegionalPlanOverrides[idx], "nested object validation failed", err) 69 } 70 } 71 } 72 for idx, elem := range obj.Extensions { 73 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 74 if err := subobj.GotenValidate(); err != nil { 75 return gotenvalidate.NewValidationError("PlanAssignment", "extensions", obj.Extensions[idx], "nested object validation failed", err) 76 } 77 } 78 } 79 for idx, elem := range obj.Allowances { 80 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 81 if err := subobj.GotenValidate(); err != nil { 82 return gotenvalidate.NewValidationError("PlanAssignment", "allowances", obj.Allowances[idx], "nested object validation failed", err) 83 } 84 } 85 } 86 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 87 return cvobj.GotenCustomValidate() 88 } 89 return nil 90 }