github.com/cloudwan/edgelq-sdk@v1.15.4/meta/client/v1alpha2/resource/resource_service.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/meta/proto/v1alpha2/resource_service.proto
     3  // DO NOT EDIT!!!
     4  
     5  package resource_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  	resource "github.com/cloudwan/edgelq-sdk/meta/resources/v1alpha2/resource"
    24  	service "github.com/cloudwan/edgelq-sdk/meta/resources/v1alpha2/service"
    25  	view "github.com/cloudwan/goten-sdk/types/view"
    26  	watch_type "github.com/cloudwan/goten-sdk/types/watch_type"
    27  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    28  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
    29  )
    30  
    31  var (
    32  	_ = bytes.Equal
    33  	_ = errors.New
    34  	_ = fmt.Errorf
    35  	_ = net.ParseIP
    36  	_ = regexp.Match
    37  	_ = strings.Split
    38  	_ = time.Now
    39  	_ = utf8.RuneCountInString
    40  	_ = url.Parse
    41  	_ = gotenvalidate.NewValidationError
    42  )
    43  
    44  // make sure we're using proto imports
    45  var (
    46  	_ = &resource.Resource{}
    47  	_ = &service.Service{}
    48  	_ = &fieldmaskpb.FieldMask{}
    49  	_ = &timestamppb.Timestamp{}
    50  	_ = view.View(0)
    51  	_ = watch_type.WatchType(0)
    52  )
    53  
    54  func (obj *GetResourceRequest) GotenValidate() error {
    55  	if obj == nil {
    56  		return nil
    57  	}
    58  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    59  		return cvobj.GotenCustomValidate()
    60  	}
    61  	return nil
    62  }
    63  func (obj *BatchGetResourcesRequest) GotenValidate() error {
    64  	if obj == nil {
    65  		return nil
    66  	}
    67  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    68  		return cvobj.GotenCustomValidate()
    69  	}
    70  	return nil
    71  }
    72  func (obj *BatchGetResourcesResponse) GotenValidate() error {
    73  	if obj == nil {
    74  		return nil
    75  	}
    76  	for idx, elem := range obj.Resources {
    77  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    78  			if err := subobj.GotenValidate(); err != nil {
    79  				return gotenvalidate.NewValidationError("BatchGetResourcesResponse", "resources", obj.Resources[idx], "nested object validation failed", err)
    80  			}
    81  		}
    82  	}
    83  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    84  		return cvobj.GotenCustomValidate()
    85  	}
    86  	return nil
    87  }
    88  func (obj *ListResourcesRequest) GotenValidate() error {
    89  	if obj == nil {
    90  		return nil
    91  	}
    92  	if !(obj.PageSize >= 0) {
    93  		return gotenvalidate.NewValidationError("ListResourcesRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
    94  	}
    95  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    96  		return cvobj.GotenCustomValidate()
    97  	}
    98  	return nil
    99  }
   100  func (obj *ListResourcesResponse) GotenValidate() error {
   101  	if obj == nil {
   102  		return nil
   103  	}
   104  	for idx, elem := range obj.Resources {
   105  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   106  			if err := subobj.GotenValidate(); err != nil {
   107  				return gotenvalidate.NewValidationError("ListResourcesResponse", "resources", obj.Resources[idx], "nested object validation failed", err)
   108  			}
   109  		}
   110  	}
   111  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   112  		return cvobj.GotenCustomValidate()
   113  	}
   114  	return nil
   115  }
   116  func (obj *WatchResourceRequest) 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 *WatchResourceResponse) GotenValidate() error {
   126  	if obj == nil {
   127  		return nil
   128  	}
   129  	if subobj, ok := interface{}(obj.Change).(gotenvalidate.Validator); ok {
   130  		if err := subobj.GotenValidate(); err != nil {
   131  			return gotenvalidate.NewValidationError("WatchResourceResponse", "change", obj.Change, "nested object validation failed", err)
   132  		}
   133  	}
   134  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   135  		return cvobj.GotenCustomValidate()
   136  	}
   137  	return nil
   138  }
   139  func (obj *WatchResourcesRequest) GotenValidate() error {
   140  	if obj == nil {
   141  		return nil
   142  	}
   143  	if !(obj.PageSize >= 0) {
   144  		return gotenvalidate.NewValidationError("WatchResourcesRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
   145  	}
   146  	if !(obj.MaxChunkSize >= 0 && obj.MaxChunkSize <= 100) {
   147  		return gotenvalidate.NewValidationError("WatchResourcesRequest", "maxChunkSize", obj.MaxChunkSize, "field must be in range [0, 100]", nil)
   148  	}
   149  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   150  		return cvobj.GotenCustomValidate()
   151  	}
   152  	return nil
   153  }
   154  func (obj *WatchResourcesResponse) GotenValidate() error {
   155  	if obj == nil {
   156  		return nil
   157  	}
   158  	for idx, elem := range obj.ResourceChanges {
   159  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   160  			if err := subobj.GotenValidate(); err != nil {
   161  				return gotenvalidate.NewValidationError("WatchResourcesResponse", "resourceChanges", obj.ResourceChanges[idx], "nested object validation failed", err)
   162  			}
   163  		}
   164  	}
   165  	if subobj, ok := interface{}(obj.PageTokenChange).(gotenvalidate.Validator); ok {
   166  		if err := subobj.GotenValidate(); err != nil {
   167  			return gotenvalidate.NewValidationError("WatchResourcesResponse", "pageTokenChange", obj.PageTokenChange, "nested object validation failed", err)
   168  		}
   169  	}
   170  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   171  		return cvobj.GotenCustomValidate()
   172  	}
   173  	return nil
   174  }
   175  func (obj *WatchResourcesResponse_PageTokenChange) GotenValidate() error {
   176  	if obj == nil {
   177  		return nil
   178  	}
   179  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   180  		return cvobj.GotenCustomValidate()
   181  	}
   182  	return nil
   183  }