github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/client/v1/alert/alert_service.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/alerting/proto/v1/alert_service.proto
     3  // DO NOT EDIT!!!
     4  
     5  package alert_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  	alert "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/alert"
    24  	log_condition "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/log_condition"
    25  	ts_condition "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/ts_condition"
    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  	_ = &alert.Alert{}
    49  	_ = &log_condition.LogCondition{}
    50  	_ = &ts_condition.TsCondition{}
    51  	_ = &emptypb.Empty{}
    52  	_ = &fieldmaskpb.FieldMask{}
    53  	_ = &timestamppb.Timestamp{}
    54  	_ = view.View(0)
    55  	_ = watch_type.WatchType(0)
    56  )
    57  
    58  func (obj *GetAlertRequest) 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 *BatchGetAlertsRequest) 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 *BatchGetAlertsResponse) GotenValidate() error {
    77  	if obj == nil {
    78  		return nil
    79  	}
    80  	for idx, elem := range obj.Alerts {
    81  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    82  			if err := subobj.GotenValidate(); err != nil {
    83  				return gotenvalidate.NewValidationError("BatchGetAlertsResponse", "alerts", obj.Alerts[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 *ListAlertsRequest) GotenValidate() error {
    93  	if obj == nil {
    94  		return nil
    95  	}
    96  	if !(obj.PageSize >= 0) {
    97  		return gotenvalidate.NewValidationError("ListAlertsRequest", "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 *ListAlertsResponse) GotenValidate() error {
   105  	if obj == nil {
   106  		return nil
   107  	}
   108  	for idx, elem := range obj.Alerts {
   109  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   110  			if err := subobj.GotenValidate(); err != nil {
   111  				return gotenvalidate.NewValidationError("ListAlertsResponse", "alerts", obj.Alerts[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 *WatchAlertRequest) 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 *WatchAlertResponse) 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("WatchAlertResponse", "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 *WatchAlertsRequest) GotenValidate() error {
   144  	if obj == nil {
   145  		return nil
   146  	}
   147  	if !(obj.PageSize >= 0) {
   148  		return gotenvalidate.NewValidationError("WatchAlertsRequest", "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("WatchAlertsRequest", "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 *WatchAlertsResponse) GotenValidate() error {
   159  	if obj == nil {
   160  		return nil
   161  	}
   162  	for idx, elem := range obj.AlertChanges {
   163  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   164  			if err := subobj.GotenValidate(); err != nil {
   165  				return gotenvalidate.NewValidationError("WatchAlertsResponse", "alertChanges", obj.AlertChanges[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("WatchAlertsResponse", "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 *WatchAlertsResponse_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 *CreateAlertRequest) GotenValidate() error {
   189  	if obj == nil {
   190  		return nil
   191  	}
   192  	if obj.Alert == nil {
   193  		return gotenvalidate.NewValidationError("CreateAlertRequest", "alert", obj.Alert, "field is required", nil)
   194  	}
   195  	if subobj, ok := interface{}(obj.Alert).(gotenvalidate.Validator); ok {
   196  		if err := subobj.GotenValidate(); err != nil {
   197  			return gotenvalidate.NewValidationError("CreateAlertRequest", "alert", obj.Alert, "nested object validation failed", err)
   198  		}
   199  	}
   200  	if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok {
   201  		if err := subobj.GotenValidate(); err != nil {
   202  			return gotenvalidate.NewValidationError("CreateAlertRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err)
   203  		}
   204  	}
   205  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   206  		return cvobj.GotenCustomValidate()
   207  	}
   208  	return nil
   209  }
   210  func (obj *CreateAlertRequest_ResponseMask) GotenValidate() error {
   211  	if obj == nil {
   212  		return nil
   213  	}
   214  	switch opt := obj.Masking.(type) {
   215  	case *CreateAlertRequest_ResponseMask_SkipEntireResponseBody:
   216  	case *CreateAlertRequest_ResponseMask_BodyMask:
   217  	default:
   218  		_ = opt
   219  	}
   220  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   221  		return cvobj.GotenCustomValidate()
   222  	}
   223  	return nil
   224  }
   225  func (obj *UpdateAlertRequest) GotenValidate() error {
   226  	if obj == nil {
   227  		return nil
   228  	}
   229  	if obj.Alert == nil {
   230  		return gotenvalidate.NewValidationError("UpdateAlertRequest", "alert", obj.Alert, "field is required", nil)
   231  	}
   232  	if subobj, ok := interface{}(obj.Alert).(gotenvalidate.Validator); ok {
   233  		if err := subobj.GotenValidate(); err != nil {
   234  			return gotenvalidate.NewValidationError("UpdateAlertRequest", "alert", obj.Alert, "nested object validation failed", err)
   235  		}
   236  	}
   237  	if subobj, ok := interface{}(obj.Cas).(gotenvalidate.Validator); ok {
   238  		if err := subobj.GotenValidate(); err != nil {
   239  			return gotenvalidate.NewValidationError("UpdateAlertRequest", "cas", obj.Cas, "nested object validation failed", err)
   240  		}
   241  	}
   242  	if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok {
   243  		if err := subobj.GotenValidate(); err != nil {
   244  			return gotenvalidate.NewValidationError("UpdateAlertRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err)
   245  		}
   246  	}
   247  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   248  		return cvobj.GotenCustomValidate()
   249  	}
   250  	return nil
   251  }
   252  func (obj *UpdateAlertRequest_CAS) GotenValidate() error {
   253  	if obj == nil {
   254  		return nil
   255  	}
   256  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   257  		return cvobj.GotenCustomValidate()
   258  	}
   259  	return nil
   260  }
   261  func (obj *UpdateAlertRequest_ResponseMask) GotenValidate() error {
   262  	if obj == nil {
   263  		return nil
   264  	}
   265  	switch opt := obj.Masking.(type) {
   266  	case *UpdateAlertRequest_ResponseMask_SkipEntireResponseBody:
   267  	case *UpdateAlertRequest_ResponseMask_UpdatedFieldsOnly:
   268  	case *UpdateAlertRequest_ResponseMask_BodyMask:
   269  	default:
   270  		_ = opt
   271  	}
   272  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   273  		return cvobj.GotenCustomValidate()
   274  	}
   275  	return nil
   276  }
   277  func (obj *DeleteAlertRequest) GotenValidate() error {
   278  	if obj == nil {
   279  		return nil
   280  	}
   281  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   282  		return cvobj.GotenCustomValidate()
   283  	}
   284  	return nil
   285  }