github.com/cloudwan/edgelq-sdk@v1.15.4/iam/resources/v1alpha2/role_binding/role_binding.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/iam/proto/v1alpha2/role_binding.proto
     3  // DO NOT EDIT!!!
     4  
     5  package role_binding
     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  	condition "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/condition"
    24  	organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/organization"
    25  	project "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/project"
    26  	role "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/role"
    27  	meta "github.com/cloudwan/goten-sdk/types/meta"
    28  )
    29  
    30  var (
    31  	_ = bytes.Equal
    32  	_ = errors.New
    33  	_ = fmt.Errorf
    34  	_ = net.ParseIP
    35  	_ = regexp.Match
    36  	_ = strings.Split
    37  	_ = time.Now
    38  	_ = utf8.RuneCountInString
    39  	_ = url.Parse
    40  	_ = gotenvalidate.NewValidationError
    41  )
    42  
    43  // make sure we're using proto imports
    44  var (
    45  	_ = &condition.Condition{}
    46  	_ = &organization.Organization{}
    47  	_ = &project.Project{}
    48  	_ = &role.Role{}
    49  	_ = &meta.Meta{}
    50  )
    51  
    52  func (obj *RoleBinding) GotenValidate() error {
    53  	if obj == nil {
    54  		return nil
    55  	}
    56  	if subobj, ok := interface{}(obj.ConditionBinding).(gotenvalidate.Validator); ok {
    57  		if err := subobj.GotenValidate(); err != nil {
    58  			return gotenvalidate.NewValidationError("RoleBinding", "conditionBinding", obj.ConditionBinding, "nested object validation failed", err)
    59  		}
    60  	}
    61  	for idx, elem := range obj.AncestryPath {
    62  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    63  			if err := subobj.GotenValidate(); err != nil {
    64  				return gotenvalidate.NewValidationError("RoleBinding", "ancestryPath", obj.AncestryPath[idx], "nested object validation failed", err)
    65  			}
    66  		}
    67  	}
    68  	if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok {
    69  		if err := subobj.GotenValidate(); err != nil {
    70  			return gotenvalidate.NewValidationError("RoleBinding", "metadata", obj.Metadata, "nested object validation failed", err)
    71  		}
    72  	}
    73  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    74  		return cvobj.GotenCustomValidate()
    75  	}
    76  	return nil
    77  }
    78  func (obj *RoleBinding_Parent) GotenValidate() error {
    79  	if obj == nil {
    80  		return nil
    81  	}
    82  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    83  		return cvobj.GotenCustomValidate()
    84  	}
    85  	return nil
    86  }