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

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/logging/proto/v1/log_custom.proto
     3  // DO NOT EDIT!!!
     4  
     5  package log_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  	rpc "github.com/cloudwan/edgelq-sdk/common/rpc"
    24  	iam_organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1/organization"
    25  	iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project"
    26  	bucket "github.com/cloudwan/edgelq-sdk/logging/resources/v1/bucket"
    27  	common "github.com/cloudwan/edgelq-sdk/logging/resources/v1/common"
    28  	log "github.com/cloudwan/edgelq-sdk/logging/resources/v1/log"
    29  	meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service"
    30  )
    31  
    32  var (
    33  	_ = bytes.Equal
    34  	_ = errors.New
    35  	_ = fmt.Errorf
    36  	_ = net.ParseIP
    37  	_ = regexp.Match
    38  	_ = strings.Split
    39  	_ = time.Now
    40  	_ = utf8.RuneCountInString
    41  	_ = url.Parse
    42  	_ = gotenvalidate.NewValidationError
    43  )
    44  
    45  // make sure we're using proto imports
    46  var (
    47  	_ = &rpc.Status{}
    48  	_ = &iam_organization.Organization{}
    49  	_ = &iam_project.Project{}
    50  	_ = &bucket.Bucket{}
    51  	_ = &common.LabelDescriptor{}
    52  	_ = &log.Log{}
    53  	_ = &meta_service.Service{}
    54  )
    55  
    56  func (obj *ListLogsRequest) GotenValidate() error {
    57  	if obj == nil {
    58  		return nil
    59  	}
    60  	if obj.Interval == nil {
    61  		return gotenvalidate.NewValidationError("ListLogsRequest", "interval", obj.Interval, "field is required", nil)
    62  	}
    63  	if subobj, ok := interface{}(obj.Interval).(gotenvalidate.Validator); ok {
    64  		if err := subobj.GotenValidate(); err != nil {
    65  			return gotenvalidate.NewValidationError("ListLogsRequest", "interval", obj.Interval, "nested object validation failed", err)
    66  		}
    67  	}
    68  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    69  		return cvobj.GotenCustomValidate()
    70  	}
    71  	return nil
    72  }
    73  func (obj *ListLogsResponse) GotenValidate() error {
    74  	if obj == nil {
    75  		return nil
    76  	}
    77  	for idx, elem := range obj.Logs {
    78  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    79  			if err := subobj.GotenValidate(); err != nil {
    80  				return gotenvalidate.NewValidationError("ListLogsResponse", "logs", obj.Logs[idx], "nested object validation failed", err)
    81  			}
    82  		}
    83  	}
    84  	for idx, elem := range obj.ExecutionErrors {
    85  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    86  			if err := subobj.GotenValidate(); err != nil {
    87  				return gotenvalidate.NewValidationError("ListLogsResponse", "executionErrors", obj.ExecutionErrors[idx], "nested object validation failed", err)
    88  			}
    89  		}
    90  	}
    91  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    92  		return cvobj.GotenCustomValidate()
    93  	}
    94  	return nil
    95  }
    96  func (obj *ListLogsResponse_ErrorDetails) GotenValidate() error {
    97  	if obj == nil {
    98  		return nil
    99  	}
   100  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   101  		return cvobj.GotenCustomValidate()
   102  	}
   103  	return nil
   104  }
   105  func (obj *CreateLogsRequest) GotenValidate() error {
   106  	if obj == nil {
   107  		return nil
   108  	}
   109  	for idx, elem := range obj.Logs {
   110  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   111  			if err := subobj.GotenValidate(); err != nil {
   112  				return gotenvalidate.NewValidationError("CreateLogsRequest", "logs", obj.Logs[idx], "nested object validation failed", err)
   113  			}
   114  		}
   115  	}
   116  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   117  		return cvobj.GotenCustomValidate()
   118  	}
   119  	return nil
   120  }
   121  func (obj *CreateLogsResponse) GotenValidate() error {
   122  	if obj == nil {
   123  		return nil
   124  	}
   125  	for idx, elem := range obj.FailedLogs {
   126  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   127  			if err := subobj.GotenValidate(); err != nil {
   128  				return gotenvalidate.NewValidationError("CreateLogsResponse", "failedLogs", obj.FailedLogs[idx], "nested object validation failed", err)
   129  			}
   130  		}
   131  	}
   132  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   133  		return cvobj.GotenCustomValidate()
   134  	}
   135  	return nil
   136  }
   137  func (obj *CreateLogsResponse_CreateError) GotenValidate() error {
   138  	if obj == nil {
   139  		return nil
   140  	}
   141  	for idx, elem := range obj.Logs {
   142  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   143  			if err := subobj.GotenValidate(); err != nil {
   144  				return gotenvalidate.NewValidationError("CreateError", "logs", obj.Logs[idx], "nested object validation failed", err)
   145  			}
   146  		}
   147  	}
   148  	if subobj, ok := interface{}(obj.Status).(gotenvalidate.Validator); ok {
   149  		if err := subobj.GotenValidate(); err != nil {
   150  			return gotenvalidate.NewValidationError("CreateError", "status", obj.Status, "nested object validation failed", err)
   151  		}
   152  	}
   153  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   154  		return cvobj.GotenCustomValidate()
   155  	}
   156  	return nil
   157  }
   158  func (obj *StreamingCreateLogsRequest) GotenValidate() error {
   159  	if obj == nil {
   160  		return nil
   161  	}
   162  	for idx, elem := range obj.Logs {
   163  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   164  			if err := subobj.GotenValidate(); err != nil {
   165  				return gotenvalidate.NewValidationError("StreamingCreateLogsRequest", "logs", obj.Logs[idx], "nested object validation failed", err)
   166  			}
   167  		}
   168  	}
   169  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   170  		return cvobj.GotenCustomValidate()
   171  	}
   172  	return nil
   173  }
   174  func (obj *StreamingCreateLogsResponse) GotenValidate() error {
   175  	if obj == nil {
   176  		return nil
   177  	}
   178  	for idx, elem := range obj.FailedLogs {
   179  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   180  			if err := subobj.GotenValidate(); err != nil {
   181  				return gotenvalidate.NewValidationError("StreamingCreateLogsResponse", "failedLogs", obj.FailedLogs[idx], "nested object validation failed", err)
   182  			}
   183  		}
   184  	}
   185  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   186  		return cvobj.GotenCustomValidate()
   187  	}
   188  	return nil
   189  }