github.com/cloudwan/edgelq-sdk@v1.15.4/limits/client/v1/limit_pool/limit_pool_service.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/limits/proto/v1/limit_pool_service.proto
     3  // DO NOT EDIT!!!
     4  
     5  package limit_pool_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  	iam_organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1/organization"
    24  	limit_pool "github.com/cloudwan/edgelq-sdk/limits/resources/v1/limit_pool"
    25  	meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service"
    26  	view "github.com/cloudwan/goten-sdk/types/view"
    27  	watch_type "github.com/cloudwan/goten-sdk/types/watch_type"
    28  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    29  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    30  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
    31  )
    32  
    33  var (
    34  	_ = bytes.Equal
    35  	_ = errors.New
    36  	_ = fmt.Errorf
    37  	_ = net.ParseIP
    38  	_ = regexp.Match
    39  	_ = strings.Split
    40  	_ = time.Now
    41  	_ = utf8.RuneCountInString
    42  	_ = url.Parse
    43  	_ = gotenvalidate.NewValidationError
    44  )
    45  
    46  // make sure we're using proto imports
    47  var (
    48  	_ = &iam_organization.Organization{}
    49  	_ = &limit_pool.LimitPool{}
    50  	_ = &emptypb.Empty{}
    51  	_ = &fieldmaskpb.FieldMask{}
    52  	_ = &timestamppb.Timestamp{}
    53  	_ = &meta_service.Service{}
    54  	_ = view.View(0)
    55  	_ = watch_type.WatchType(0)
    56  )
    57  
    58  func (obj *GetLimitPoolRequest) GotenValidate() error {
    59  	if obj == nil {
    60  		return nil
    61  	}
    62  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    63  		return cvobj.GotenCustomValidate()
    64  	}
    65  	return nil
    66  }
    67  func (obj *BatchGetLimitPoolsRequest) GotenValidate() error {
    68  	if obj == nil {
    69  		return nil
    70  	}
    71  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    72  		return cvobj.GotenCustomValidate()
    73  	}
    74  	return nil
    75  }
    76  func (obj *BatchGetLimitPoolsResponse) GotenValidate() error {
    77  	if obj == nil {
    78  		return nil
    79  	}
    80  	for idx, elem := range obj.LimitPools {
    81  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    82  			if err := subobj.GotenValidate(); err != nil {
    83  				return gotenvalidate.NewValidationError("BatchGetLimitPoolsResponse", "limitPools", obj.LimitPools[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 *ListLimitPoolsRequest) GotenValidate() error {
    93  	if obj == nil {
    94  		return nil
    95  	}
    96  	if !(obj.PageSize >= 0) {
    97  		return gotenvalidate.NewValidationError("ListLimitPoolsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
    98  	}
    99  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   100  		return cvobj.GotenCustomValidate()
   101  	}
   102  	return nil
   103  }
   104  func (obj *ListLimitPoolsResponse) GotenValidate() error {
   105  	if obj == nil {
   106  		return nil
   107  	}
   108  	for idx, elem := range obj.LimitPools {
   109  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   110  			if err := subobj.GotenValidate(); err != nil {
   111  				return gotenvalidate.NewValidationError("ListLimitPoolsResponse", "limitPools", obj.LimitPools[idx], "nested object validation failed", err)
   112  			}
   113  		}
   114  	}
   115  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   116  		return cvobj.GotenCustomValidate()
   117  	}
   118  	return nil
   119  }
   120  func (obj *WatchLimitPoolRequest) GotenValidate() error {
   121  	if obj == nil {
   122  		return nil
   123  	}
   124  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   125  		return cvobj.GotenCustomValidate()
   126  	}
   127  	return nil
   128  }
   129  func (obj *WatchLimitPoolResponse) GotenValidate() error {
   130  	if obj == nil {
   131  		return nil
   132  	}
   133  	if subobj, ok := interface{}(obj.Change).(gotenvalidate.Validator); ok {
   134  		if err := subobj.GotenValidate(); err != nil {
   135  			return gotenvalidate.NewValidationError("WatchLimitPoolResponse", "change", obj.Change, "nested object validation failed", err)
   136  		}
   137  	}
   138  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   139  		return cvobj.GotenCustomValidate()
   140  	}
   141  	return nil
   142  }
   143  func (obj *WatchLimitPoolsRequest) GotenValidate() error {
   144  	if obj == nil {
   145  		return nil
   146  	}
   147  	if !(obj.PageSize >= 0) {
   148  		return gotenvalidate.NewValidationError("WatchLimitPoolsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
   149  	}
   150  	if !(obj.MaxChunkSize >= 0 && obj.MaxChunkSize <= 100) {
   151  		return gotenvalidate.NewValidationError("WatchLimitPoolsRequest", "maxChunkSize", obj.MaxChunkSize, "field must be in range [0, 100]", nil)
   152  	}
   153  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   154  		return cvobj.GotenCustomValidate()
   155  	}
   156  	return nil
   157  }
   158  func (obj *WatchLimitPoolsResponse) GotenValidate() error {
   159  	if obj == nil {
   160  		return nil
   161  	}
   162  	for idx, elem := range obj.LimitPoolChanges {
   163  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   164  			if err := subobj.GotenValidate(); err != nil {
   165  				return gotenvalidate.NewValidationError("WatchLimitPoolsResponse", "limitPoolChanges", obj.LimitPoolChanges[idx], "nested object validation failed", err)
   166  			}
   167  		}
   168  	}
   169  	if subobj, ok := interface{}(obj.PageTokenChange).(gotenvalidate.Validator); ok {
   170  		if err := subobj.GotenValidate(); err != nil {
   171  			return gotenvalidate.NewValidationError("WatchLimitPoolsResponse", "pageTokenChange", obj.PageTokenChange, "nested object validation failed", err)
   172  		}
   173  	}
   174  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   175  		return cvobj.GotenCustomValidate()
   176  	}
   177  	return nil
   178  }
   179  func (obj *WatchLimitPoolsResponse_PageTokenChange) GotenValidate() error {
   180  	if obj == nil {
   181  		return nil
   182  	}
   183  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   184  		return cvobj.GotenCustomValidate()
   185  	}
   186  	return nil
   187  }
   188  func (obj *UpdateLimitPoolRequest) GotenValidate() error {
   189  	if obj == nil {
   190  		return nil
   191  	}
   192  	if obj.LimitPool == nil {
   193  		return gotenvalidate.NewValidationError("UpdateLimitPoolRequest", "limitPool", obj.LimitPool, "field is required", nil)
   194  	}
   195  	if subobj, ok := interface{}(obj.LimitPool).(gotenvalidate.Validator); ok {
   196  		if err := subobj.GotenValidate(); err != nil {
   197  			return gotenvalidate.NewValidationError("UpdateLimitPoolRequest", "limitPool", obj.LimitPool, "nested object validation failed", err)
   198  		}
   199  	}
   200  	if subobj, ok := interface{}(obj.Cas).(gotenvalidate.Validator); ok {
   201  		if err := subobj.GotenValidate(); err != nil {
   202  			return gotenvalidate.NewValidationError("UpdateLimitPoolRequest", "cas", obj.Cas, "nested object validation failed", err)
   203  		}
   204  	}
   205  	if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok {
   206  		if err := subobj.GotenValidate(); err != nil {
   207  			return gotenvalidate.NewValidationError("UpdateLimitPoolRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err)
   208  		}
   209  	}
   210  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   211  		return cvobj.GotenCustomValidate()
   212  	}
   213  	return nil
   214  }
   215  func (obj *UpdateLimitPoolRequest_CAS) GotenValidate() error {
   216  	if obj == nil {
   217  		return nil
   218  	}
   219  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   220  		return cvobj.GotenCustomValidate()
   221  	}
   222  	return nil
   223  }
   224  func (obj *UpdateLimitPoolRequest_ResponseMask) GotenValidate() error {
   225  	if obj == nil {
   226  		return nil
   227  	}
   228  	switch opt := obj.Masking.(type) {
   229  	case *UpdateLimitPoolRequest_ResponseMask_SkipEntireResponseBody:
   230  	case *UpdateLimitPoolRequest_ResponseMask_UpdatedFieldsOnly:
   231  	case *UpdateLimitPoolRequest_ResponseMask_BodyMask:
   232  	default:
   233  		_ = opt
   234  	}
   235  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   236  		return cvobj.GotenCustomValidate()
   237  	}
   238  	return nil
   239  }
   240  func (obj *DeleteLimitPoolRequest) GotenValidate() error {
   241  	if obj == nil {
   242  		return nil
   243  	}
   244  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   245  		return cvobj.GotenCustomValidate()
   246  	}
   247  	return nil
   248  }