github.com/cloudwan/edgelq-sdk@v1.15.4/iam/client/v1/common/common_client.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/iam/proto/v1/common_client.proto
     3  // DO NOT EDIT!!!
     4  
     5  package iam_common
     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  	group "github.com/cloudwan/edgelq-sdk/iam/resources/v1/group"
    24  	service_account "github.com/cloudwan/edgelq-sdk/iam/resources/v1/service_account"
    25  	user "github.com/cloudwan/edgelq-sdk/iam/resources/v1/user"
    26  	view "github.com/cloudwan/goten-sdk/types/view"
    27  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    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  	_ = &group.Group{}
    46  	_ = &service_account.ServiceAccount{}
    47  	_ = &user.User{}
    48  	_ = &fieldmaskpb.FieldMask{}
    49  	_ = view.View(0)
    50  )
    51  
    52  func (obj *MembersMasks) GotenValidate() error {
    53  	if obj == nil {
    54  		return nil
    55  	}
    56  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    57  		return cvobj.GotenCustomValidate()
    58  	}
    59  	return nil
    60  }
    61  func (obj *MembersInfo) GotenValidate() error {
    62  	if obj == nil {
    63  		return nil
    64  	}
    65  	for idx, elem := range obj.Users {
    66  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    67  			if err := subobj.GotenValidate(); err != nil {
    68  				return gotenvalidate.NewValidationError("MembersInfo", "users", obj.Users[idx], "nested object validation failed", err)
    69  			}
    70  		}
    71  	}
    72  	for idx, elem := range obj.ServiceAccounts {
    73  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    74  			if err := subobj.GotenValidate(); err != nil {
    75  				return gotenvalidate.NewValidationError("MembersInfo", "serviceAccounts", obj.ServiceAccounts[idx], "nested object validation failed", err)
    76  			}
    77  		}
    78  	}
    79  	for idx, elem := range obj.Groups {
    80  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    81  			if err := subobj.GotenValidate(); err != nil {
    82  				return gotenvalidate.NewValidationError("MembersInfo", "groups", obj.Groups[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  }