github.com/cloudwan/edgelq-sdk@v1.15.4/audit/client/v1alpha2/method_descriptor/method_descriptor_service.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/audit/proto/v1alpha2/method_descriptor_service.proto
     3  // DO NOT EDIT!!!
     4  
     5  package method_descriptor_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  	method_descriptor "github.com/cloudwan/edgelq-sdk/audit/resources/v1alpha2/method_descriptor"
    24  	view "github.com/cloudwan/goten-sdk/types/view"
    25  	watch_type "github.com/cloudwan/goten-sdk/types/watch_type"
    26  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    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  	_ = &method_descriptor.MethodDescriptor{}
    46  	_ = &fieldmaskpb.FieldMask{}
    47  	_ = &timestamppb.Timestamp{}
    48  	_ = view.View(0)
    49  	_ = watch_type.WatchType(0)
    50  )
    51  
    52  func (obj *GetMethodDescriptorRequest) 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 *BatchGetMethodDescriptorsRequest) GotenValidate() error {
    62  	if obj == nil {
    63  		return nil
    64  	}
    65  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    66  		return cvobj.GotenCustomValidate()
    67  	}
    68  	return nil
    69  }
    70  func (obj *BatchGetMethodDescriptorsResponse) GotenValidate() error {
    71  	if obj == nil {
    72  		return nil
    73  	}
    74  	for idx, elem := range obj.MethodDescriptors {
    75  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    76  			if err := subobj.GotenValidate(); err != nil {
    77  				return gotenvalidate.NewValidationError("BatchGetMethodDescriptorsResponse", "methodDescriptors", obj.MethodDescriptors[idx], "nested object validation failed", err)
    78  			}
    79  		}
    80  	}
    81  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    82  		return cvobj.GotenCustomValidate()
    83  	}
    84  	return nil
    85  }
    86  func (obj *ListMethodDescriptorsRequest) GotenValidate() error {
    87  	if obj == nil {
    88  		return nil
    89  	}
    90  	if !(obj.PageSize >= 0) {
    91  		return gotenvalidate.NewValidationError("ListMethodDescriptorsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
    92  	}
    93  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    94  		return cvobj.GotenCustomValidate()
    95  	}
    96  	return nil
    97  }
    98  func (obj *ListMethodDescriptorsResponse) GotenValidate() error {
    99  	if obj == nil {
   100  		return nil
   101  	}
   102  	for idx, elem := range obj.MethodDescriptors {
   103  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   104  			if err := subobj.GotenValidate(); err != nil {
   105  				return gotenvalidate.NewValidationError("ListMethodDescriptorsResponse", "methodDescriptors", obj.MethodDescriptors[idx], "nested object validation failed", err)
   106  			}
   107  		}
   108  	}
   109  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   110  		return cvobj.GotenCustomValidate()
   111  	}
   112  	return nil
   113  }
   114  func (obj *WatchMethodDescriptorRequest) GotenValidate() error {
   115  	if obj == nil {
   116  		return nil
   117  	}
   118  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   119  		return cvobj.GotenCustomValidate()
   120  	}
   121  	return nil
   122  }
   123  func (obj *WatchMethodDescriptorResponse) GotenValidate() error {
   124  	if obj == nil {
   125  		return nil
   126  	}
   127  	if subobj, ok := interface{}(obj.Change).(gotenvalidate.Validator); ok {
   128  		if err := subobj.GotenValidate(); err != nil {
   129  			return gotenvalidate.NewValidationError("WatchMethodDescriptorResponse", "change", obj.Change, "nested object validation failed", err)
   130  		}
   131  	}
   132  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   133  		return cvobj.GotenCustomValidate()
   134  	}
   135  	return nil
   136  }
   137  func (obj *WatchMethodDescriptorsRequest) GotenValidate() error {
   138  	if obj == nil {
   139  		return nil
   140  	}
   141  	if !(obj.PageSize >= 0) {
   142  		return gotenvalidate.NewValidationError("WatchMethodDescriptorsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
   143  	}
   144  	if !(obj.MaxChunkSize >= 0 && obj.MaxChunkSize <= 100) {
   145  		return gotenvalidate.NewValidationError("WatchMethodDescriptorsRequest", "maxChunkSize", obj.MaxChunkSize, "field must be in range [0, 100]", nil)
   146  	}
   147  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   148  		return cvobj.GotenCustomValidate()
   149  	}
   150  	return nil
   151  }
   152  func (obj *WatchMethodDescriptorsResponse) GotenValidate() error {
   153  	if obj == nil {
   154  		return nil
   155  	}
   156  	for idx, elem := range obj.MethodDescriptorChanges {
   157  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   158  			if err := subobj.GotenValidate(); err != nil {
   159  				return gotenvalidate.NewValidationError("WatchMethodDescriptorsResponse", "methodDescriptorChanges", obj.MethodDescriptorChanges[idx], "nested object validation failed", err)
   160  			}
   161  		}
   162  	}
   163  	if subobj, ok := interface{}(obj.PageTokenChange).(gotenvalidate.Validator); ok {
   164  		if err := subobj.GotenValidate(); err != nil {
   165  			return gotenvalidate.NewValidationError("WatchMethodDescriptorsResponse", "pageTokenChange", obj.PageTokenChange, "nested object validation failed", err)
   166  		}
   167  	}
   168  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   169  		return cvobj.GotenCustomValidate()
   170  	}
   171  	return nil
   172  }
   173  func (obj *WatchMethodDescriptorsResponse_PageTokenChange) GotenValidate() error {
   174  	if obj == nil {
   175  		return nil
   176  	}
   177  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   178  		return cvobj.GotenCustomValidate()
   179  	}
   180  	return nil
   181  }
   182  func (obj *CreateMethodDescriptorRequest) GotenValidate() error {
   183  	if obj == nil {
   184  		return nil
   185  	}
   186  	if obj.MethodDescriptor == nil {
   187  		return gotenvalidate.NewValidationError("CreateMethodDescriptorRequest", "methodDescriptor", obj.MethodDescriptor, "field is required", nil)
   188  	}
   189  	if subobj, ok := interface{}(obj.MethodDescriptor).(gotenvalidate.Validator); ok {
   190  		if err := subobj.GotenValidate(); err != nil {
   191  			return gotenvalidate.NewValidationError("CreateMethodDescriptorRequest", "methodDescriptor", obj.MethodDescriptor, "nested object validation failed", err)
   192  		}
   193  	}
   194  	if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok {
   195  		if err := subobj.GotenValidate(); err != nil {
   196  			return gotenvalidate.NewValidationError("CreateMethodDescriptorRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err)
   197  		}
   198  	}
   199  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   200  		return cvobj.GotenCustomValidate()
   201  	}
   202  	return nil
   203  }
   204  func (obj *CreateMethodDescriptorRequest_ResponseMask) GotenValidate() error {
   205  	if obj == nil {
   206  		return nil
   207  	}
   208  	switch opt := obj.Masking.(type) {
   209  	case *CreateMethodDescriptorRequest_ResponseMask_SkipEntireResponseBody:
   210  	case *CreateMethodDescriptorRequest_ResponseMask_BodyMask:
   211  	default:
   212  		_ = opt
   213  	}
   214  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   215  		return cvobj.GotenCustomValidate()
   216  	}
   217  	return nil
   218  }
   219  func (obj *UpdateMethodDescriptorRequest) GotenValidate() error {
   220  	if obj == nil {
   221  		return nil
   222  	}
   223  	if obj.MethodDescriptor == nil {
   224  		return gotenvalidate.NewValidationError("UpdateMethodDescriptorRequest", "methodDescriptor", obj.MethodDescriptor, "field is required", nil)
   225  	}
   226  	if subobj, ok := interface{}(obj.MethodDescriptor).(gotenvalidate.Validator); ok {
   227  		if err := subobj.GotenValidate(); err != nil {
   228  			return gotenvalidate.NewValidationError("UpdateMethodDescriptorRequest", "methodDescriptor", obj.MethodDescriptor, "nested object validation failed", err)
   229  		}
   230  	}
   231  	if subobj, ok := interface{}(obj.Cas).(gotenvalidate.Validator); ok {
   232  		if err := subobj.GotenValidate(); err != nil {
   233  			return gotenvalidate.NewValidationError("UpdateMethodDescriptorRequest", "cas", obj.Cas, "nested object validation failed", err)
   234  		}
   235  	}
   236  	if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok {
   237  		if err := subobj.GotenValidate(); err != nil {
   238  			return gotenvalidate.NewValidationError("UpdateMethodDescriptorRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err)
   239  		}
   240  	}
   241  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   242  		return cvobj.GotenCustomValidate()
   243  	}
   244  	return nil
   245  }
   246  func (obj *UpdateMethodDescriptorRequest_CAS) GotenValidate() error {
   247  	if obj == nil {
   248  		return nil
   249  	}
   250  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   251  		return cvobj.GotenCustomValidate()
   252  	}
   253  	return nil
   254  }
   255  func (obj *UpdateMethodDescriptorRequest_ResponseMask) GotenValidate() error {
   256  	if obj == nil {
   257  		return nil
   258  	}
   259  	switch opt := obj.Masking.(type) {
   260  	case *UpdateMethodDescriptorRequest_ResponseMask_SkipEntireResponseBody:
   261  	case *UpdateMethodDescriptorRequest_ResponseMask_UpdatedFieldsOnly:
   262  	case *UpdateMethodDescriptorRequest_ResponseMask_BodyMask:
   263  	default:
   264  		_ = opt
   265  	}
   266  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   267  		return cvobj.GotenCustomValidate()
   268  	}
   269  	return nil
   270  }