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

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/iam/proto/v1/project_custom.proto
     3  // DO NOT EDIT!!!
     4  
     5  package project_client
     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  	project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project"
    24  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    25  )
    26  
    27  var (
    28  	_ = bytes.Equal
    29  	_ = errors.New
    30  	_ = fmt.Errorf
    31  	_ = net.ParseIP
    32  	_ = regexp.Match
    33  	_ = strings.Split
    34  	_ = time.Now
    35  	_ = utf8.RuneCountInString
    36  	_ = url.Parse
    37  	_ = gotenvalidate.NewValidationError
    38  )
    39  
    40  // make sure we're using proto imports
    41  var (
    42  	_ = &project.Project{}
    43  	_ = &fieldmaskpb.FieldMask{}
    44  )
    45  
    46  func (obj *ListMyProjectsRequest) GotenValidate() error {
    47  	if obj == nil {
    48  		return nil
    49  	}
    50  	if !(obj.PageSize >= 0) {
    51  		return gotenvalidate.NewValidationError("ListMyProjectsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
    52  	}
    53  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    54  		return cvobj.GotenCustomValidate()
    55  	}
    56  	return nil
    57  }
    58  func (obj *ListMyProjectsResponse) GotenValidate() error {
    59  	if obj == nil {
    60  		return nil
    61  	}
    62  	for idx, elem := range obj.Projects {
    63  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    64  			if err := subobj.GotenValidate(); err != nil {
    65  				return gotenvalidate.NewValidationError("ListMyProjectsResponse", "projects", obj.Projects[idx], "nested object validation failed", err)
    66  			}
    67  		}
    68  	}
    69  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    70  		return cvobj.GotenCustomValidate()
    71  	}
    72  	return nil
    73  }
    74  func (obj *SearchMyProjectsRequest) GotenValidate() error {
    75  	if obj == nil {
    76  		return nil
    77  	}
    78  	if !(obj.PageSize >= 0) {
    79  		return gotenvalidate.NewValidationError("SearchMyProjectsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
    80  	}
    81  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    82  		return cvobj.GotenCustomValidate()
    83  	}
    84  	return nil
    85  }
    86  func (obj *SearchMyProjectsResponse) GotenValidate() error {
    87  	if obj == nil {
    88  		return nil
    89  	}
    90  	for idx, elem := range obj.Projects {
    91  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    92  			if err := subobj.GotenValidate(); err != nil {
    93  				return gotenvalidate.NewValidationError("SearchMyProjectsResponse", "projects", obj.Projects[idx], "nested object validation failed", err)
    94  			}
    95  		}
    96  	}
    97  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    98  		return cvobj.GotenCustomValidate()
    99  	}
   100  	return nil
   101  }