github.com/cloudwan/edgelq-sdk@v1.15.4/logging/client/v1/log_descriptor/log_descriptor_service.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/logging/proto/v1/log_descriptor_service.proto
     3  // DO NOT EDIT!!!
     4  
     5  package log_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  	iam_organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1/organization"
    24  	iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project"
    25  	log_descriptor "github.com/cloudwan/edgelq-sdk/logging/resources/v1/log_descriptor"
    26  	meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service"
    27  	view "github.com/cloudwan/goten-sdk/types/view"
    28  	watch_type "github.com/cloudwan/goten-sdk/types/watch_type"
    29  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    30  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    31  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
    32  )
    33  
    34  var (
    35  	_ = bytes.Equal
    36  	_ = errors.New
    37  	_ = fmt.Errorf
    38  	_ = net.ParseIP
    39  	_ = regexp.Match
    40  	_ = strings.Split
    41  	_ = time.Now
    42  	_ = utf8.RuneCountInString
    43  	_ = url.Parse
    44  	_ = gotenvalidate.NewValidationError
    45  )
    46  
    47  // make sure we're using proto imports
    48  var (
    49  	_ = &iam_organization.Organization{}
    50  	_ = &iam_project.Project{}
    51  	_ = &log_descriptor.LogDescriptor{}
    52  	_ = &emptypb.Empty{}
    53  	_ = &fieldmaskpb.FieldMask{}
    54  	_ = &timestamppb.Timestamp{}
    55  	_ = &meta_service.Service{}
    56  	_ = view.View(0)
    57  	_ = watch_type.WatchType(0)
    58  )
    59  
    60  func (obj *GetLogDescriptorRequest) GotenValidate() error {
    61  	if obj == nil {
    62  		return nil
    63  	}
    64  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    65  		return cvobj.GotenCustomValidate()
    66  	}
    67  	return nil
    68  }
    69  func (obj *BatchGetLogDescriptorsRequest) GotenValidate() error {
    70  	if obj == nil {
    71  		return nil
    72  	}
    73  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    74  		return cvobj.GotenCustomValidate()
    75  	}
    76  	return nil
    77  }
    78  func (obj *BatchGetLogDescriptorsResponse) GotenValidate() error {
    79  	if obj == nil {
    80  		return nil
    81  	}
    82  	for idx, elem := range obj.LogDescriptors {
    83  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    84  			if err := subobj.GotenValidate(); err != nil {
    85  				return gotenvalidate.NewValidationError("BatchGetLogDescriptorsResponse", "logDescriptors", obj.LogDescriptors[idx], "nested object validation failed", err)
    86  			}
    87  		}
    88  	}
    89  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    90  		return cvobj.GotenCustomValidate()
    91  	}
    92  	return nil
    93  }
    94  func (obj *ListLogDescriptorsRequest) GotenValidate() error {
    95  	if obj == nil {
    96  		return nil
    97  	}
    98  	if !(obj.PageSize >= 0) {
    99  		return gotenvalidate.NewValidationError("ListLogDescriptorsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
   100  	}
   101  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   102  		return cvobj.GotenCustomValidate()
   103  	}
   104  	return nil
   105  }
   106  func (obj *ListLogDescriptorsResponse) GotenValidate() error {
   107  	if obj == nil {
   108  		return nil
   109  	}
   110  	for idx, elem := range obj.LogDescriptors {
   111  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   112  			if err := subobj.GotenValidate(); err != nil {
   113  				return gotenvalidate.NewValidationError("ListLogDescriptorsResponse", "logDescriptors", obj.LogDescriptors[idx], "nested object validation failed", err)
   114  			}
   115  		}
   116  	}
   117  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   118  		return cvobj.GotenCustomValidate()
   119  	}
   120  	return nil
   121  }
   122  func (obj *WatchLogDescriptorRequest) GotenValidate() error {
   123  	if obj == nil {
   124  		return nil
   125  	}
   126  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   127  		return cvobj.GotenCustomValidate()
   128  	}
   129  	return nil
   130  }
   131  func (obj *WatchLogDescriptorResponse) GotenValidate() error {
   132  	if obj == nil {
   133  		return nil
   134  	}
   135  	if subobj, ok := interface{}(obj.Change).(gotenvalidate.Validator); ok {
   136  		if err := subobj.GotenValidate(); err != nil {
   137  			return gotenvalidate.NewValidationError("WatchLogDescriptorResponse", "change", obj.Change, "nested object validation failed", err)
   138  		}
   139  	}
   140  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   141  		return cvobj.GotenCustomValidate()
   142  	}
   143  	return nil
   144  }
   145  func (obj *WatchLogDescriptorsRequest) GotenValidate() error {
   146  	if obj == nil {
   147  		return nil
   148  	}
   149  	if !(obj.PageSize >= 0) {
   150  		return gotenvalidate.NewValidationError("WatchLogDescriptorsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
   151  	}
   152  	if !(obj.MaxChunkSize >= 0 && obj.MaxChunkSize <= 100) {
   153  		return gotenvalidate.NewValidationError("WatchLogDescriptorsRequest", "maxChunkSize", obj.MaxChunkSize, "field must be in range [0, 100]", nil)
   154  	}
   155  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   156  		return cvobj.GotenCustomValidate()
   157  	}
   158  	return nil
   159  }
   160  func (obj *WatchLogDescriptorsResponse) GotenValidate() error {
   161  	if obj == nil {
   162  		return nil
   163  	}
   164  	for idx, elem := range obj.LogDescriptorChanges {
   165  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   166  			if err := subobj.GotenValidate(); err != nil {
   167  				return gotenvalidate.NewValidationError("WatchLogDescriptorsResponse", "logDescriptorChanges", obj.LogDescriptorChanges[idx], "nested object validation failed", err)
   168  			}
   169  		}
   170  	}
   171  	if subobj, ok := interface{}(obj.PageTokenChange).(gotenvalidate.Validator); ok {
   172  		if err := subobj.GotenValidate(); err != nil {
   173  			return gotenvalidate.NewValidationError("WatchLogDescriptorsResponse", "pageTokenChange", obj.PageTokenChange, "nested object validation failed", err)
   174  		}
   175  	}
   176  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   177  		return cvobj.GotenCustomValidate()
   178  	}
   179  	return nil
   180  }
   181  func (obj *WatchLogDescriptorsResponse_PageTokenChange) GotenValidate() error {
   182  	if obj == nil {
   183  		return nil
   184  	}
   185  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   186  		return cvobj.GotenCustomValidate()
   187  	}
   188  	return nil
   189  }
   190  func (obj *CreateLogDescriptorRequest) GotenValidate() error {
   191  	if obj == nil {
   192  		return nil
   193  	}
   194  	if obj.LogDescriptor == nil {
   195  		return gotenvalidate.NewValidationError("CreateLogDescriptorRequest", "logDescriptor", obj.LogDescriptor, "field is required", nil)
   196  	}
   197  	if subobj, ok := interface{}(obj.LogDescriptor).(gotenvalidate.Validator); ok {
   198  		if err := subobj.GotenValidate(); err != nil {
   199  			return gotenvalidate.NewValidationError("CreateLogDescriptorRequest", "logDescriptor", obj.LogDescriptor, "nested object validation failed", err)
   200  		}
   201  	}
   202  	if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok {
   203  		if err := subobj.GotenValidate(); err != nil {
   204  			return gotenvalidate.NewValidationError("CreateLogDescriptorRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err)
   205  		}
   206  	}
   207  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   208  		return cvobj.GotenCustomValidate()
   209  	}
   210  	return nil
   211  }
   212  func (obj *CreateLogDescriptorRequest_ResponseMask) GotenValidate() error {
   213  	if obj == nil {
   214  		return nil
   215  	}
   216  	switch opt := obj.Masking.(type) {
   217  	case *CreateLogDescriptorRequest_ResponseMask_SkipEntireResponseBody:
   218  	case *CreateLogDescriptorRequest_ResponseMask_BodyMask:
   219  	default:
   220  		_ = opt
   221  	}
   222  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   223  		return cvobj.GotenCustomValidate()
   224  	}
   225  	return nil
   226  }
   227  func (obj *UpdateLogDescriptorRequest) GotenValidate() error {
   228  	if obj == nil {
   229  		return nil
   230  	}
   231  	if obj.LogDescriptor == nil {
   232  		return gotenvalidate.NewValidationError("UpdateLogDescriptorRequest", "logDescriptor", obj.LogDescriptor, "field is required", nil)
   233  	}
   234  	if subobj, ok := interface{}(obj.LogDescriptor).(gotenvalidate.Validator); ok {
   235  		if err := subobj.GotenValidate(); err != nil {
   236  			return gotenvalidate.NewValidationError("UpdateLogDescriptorRequest", "logDescriptor", obj.LogDescriptor, "nested object validation failed", err)
   237  		}
   238  	}
   239  	if subobj, ok := interface{}(obj.Cas).(gotenvalidate.Validator); ok {
   240  		if err := subobj.GotenValidate(); err != nil {
   241  			return gotenvalidate.NewValidationError("UpdateLogDescriptorRequest", "cas", obj.Cas, "nested object validation failed", err)
   242  		}
   243  	}
   244  	if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok {
   245  		if err := subobj.GotenValidate(); err != nil {
   246  			return gotenvalidate.NewValidationError("UpdateLogDescriptorRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err)
   247  		}
   248  	}
   249  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   250  		return cvobj.GotenCustomValidate()
   251  	}
   252  	return nil
   253  }
   254  func (obj *UpdateLogDescriptorRequest_CAS) GotenValidate() error {
   255  	if obj == nil {
   256  		return nil
   257  	}
   258  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   259  		return cvobj.GotenCustomValidate()
   260  	}
   261  	return nil
   262  }
   263  func (obj *UpdateLogDescriptorRequest_ResponseMask) GotenValidate() error {
   264  	if obj == nil {
   265  		return nil
   266  	}
   267  	switch opt := obj.Masking.(type) {
   268  	case *UpdateLogDescriptorRequest_ResponseMask_SkipEntireResponseBody:
   269  	case *UpdateLogDescriptorRequest_ResponseMask_UpdatedFieldsOnly:
   270  	case *UpdateLogDescriptorRequest_ResponseMask_BodyMask:
   271  	default:
   272  		_ = opt
   273  	}
   274  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   275  		return cvobj.GotenCustomValidate()
   276  	}
   277  	return nil
   278  }
   279  func (obj *DeleteLogDescriptorRequest) GotenValidate() error {
   280  	if obj == nil {
   281  		return nil
   282  	}
   283  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   284  		return cvobj.GotenCustomValidate()
   285  	}
   286  	return nil
   287  }