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

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/applications/proto/v1alpha2/pod.proto
     3  // DO NOT EDIT!!!
     4  
     5  package pod
     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  	common "github.com/cloudwan/edgelq-sdk/applications/resources/v1alpha2/common"
    24  	distribution "github.com/cloudwan/edgelq-sdk/applications/resources/v1alpha2/distribution"
    25  	project "github.com/cloudwan/edgelq-sdk/applications/resources/v1alpha2/project"
    26  	meta "github.com/cloudwan/goten-sdk/types/meta"
    27  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
    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  	_ = &common.PodSpec{}
    46  	_ = &distribution.Distribution{}
    47  	_ = &project.Project{}
    48  	_ = &timestamppb.Timestamp{}
    49  	_ = &meta.Meta{}
    50  )
    51  
    52  func (obj *Pod) GotenValidate() error {
    53  	if obj == nil {
    54  		return nil
    55  	}
    56  	if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok {
    57  		if err := subobj.GotenValidate(); err != nil {
    58  			return gotenvalidate.NewValidationError("Pod", "metadata", obj.Metadata, "nested object validation failed", err)
    59  		}
    60  	}
    61  	if subobj, ok := interface{}(obj.Spec).(gotenvalidate.Validator); ok {
    62  		if err := subobj.GotenValidate(); err != nil {
    63  			return gotenvalidate.NewValidationError("Pod", "spec", obj.Spec, "nested object validation failed", err)
    64  		}
    65  	}
    66  	if subobj, ok := interface{}(obj.Status).(gotenvalidate.Validator); ok {
    67  		if err := subobj.GotenValidate(); err != nil {
    68  			return gotenvalidate.NewValidationError("Pod", "status", obj.Status, "nested object validation failed", err)
    69  		}
    70  	}
    71  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    72  		return cvobj.GotenCustomValidate()
    73  	}
    74  	return nil
    75  }
    76  func (obj *Pod_Status) GotenValidate() error {
    77  	if obj == nil {
    78  		return nil
    79  	}
    80  	for idx, elem := range obj.ContainerStatuses {
    81  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    82  			if err := subobj.GotenValidate(); err != nil {
    83  				return gotenvalidate.NewValidationError("Status", "containerStatuses", obj.ContainerStatuses[idx], "nested object validation failed", err)
    84  			}
    85  		}
    86  	}
    87  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    88  		return cvobj.GotenCustomValidate()
    89  	}
    90  	return nil
    91  }
    92  func (obj *Pod_Status_Container) GotenValidate() error {
    93  	if obj == nil {
    94  		return nil
    95  	}
    96  	if subobj, ok := interface{}(obj.Waiting).(gotenvalidate.Validator); ok {
    97  		if err := subobj.GotenValidate(); err != nil {
    98  			return gotenvalidate.NewValidationError("Container", "waiting", obj.Waiting, "nested object validation failed", err)
    99  		}
   100  	}
   101  	if subobj, ok := interface{}(obj.Running).(gotenvalidate.Validator); ok {
   102  		if err := subobj.GotenValidate(); err != nil {
   103  			return gotenvalidate.NewValidationError("Container", "running", obj.Running, "nested object validation failed", err)
   104  		}
   105  	}
   106  	if subobj, ok := interface{}(obj.Terminated).(gotenvalidate.Validator); ok {
   107  		if err := subobj.GotenValidate(); err != nil {
   108  			return gotenvalidate.NewValidationError("Container", "terminated", obj.Terminated, "nested object validation failed", err)
   109  		}
   110  	}
   111  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   112  		return cvobj.GotenCustomValidate()
   113  	}
   114  	return nil
   115  }
   116  func (obj *Pod_Status_Container_StateWaiting) GotenValidate() error {
   117  	if obj == nil {
   118  		return nil
   119  	}
   120  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   121  		return cvobj.GotenCustomValidate()
   122  	}
   123  	return nil
   124  }
   125  func (obj *Pod_Status_Container_StateRunning) GotenValidate() error {
   126  	if obj == nil {
   127  		return nil
   128  	}
   129  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   130  		return cvobj.GotenCustomValidate()
   131  	}
   132  	return nil
   133  }
   134  func (obj *Pod_Status_Container_StateTerminated) GotenValidate() error {
   135  	if obj == nil {
   136  		return nil
   137  	}
   138  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   139  		return cvobj.GotenCustomValidate()
   140  	}
   141  	return nil
   142  }