github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v3/notification/notification.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/monitoring/proto/v3/notification.proto
     3  // DO NOT EDIT!!!
     4  
     5  package notification
     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/monitoring/resources/v3/alert"
    24  	alerting_condition "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/alerting_condition"
    25  	alerting_policy "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/alerting_policy"
    26  	common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/common"
    27  	notification_channel "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/notification_channel"
    28  	project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/project"
    29  	meta "github.com/cloudwan/goten-sdk/types/meta"
    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  	_ = &alert.Alert{}
    48  	_ = &alerting_condition.AlertingCondition{}
    49  	_ = &alerting_policy.AlertingPolicy{}
    50  	_ = &common.LabelDescriptor{}
    51  	_ = &notification_channel.NotificationChannel{}
    52  	_ = &project.Project{}
    53  	_ = &meta.Meta{}
    54  )
    55  
    56  func (obj *Notification) GotenValidate() error {
    57  	if obj == nil {
    58  		return nil
    59  	}
    60  	if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok {
    61  		if err := subobj.GotenValidate(); err != nil {
    62  			return gotenvalidate.NewValidationError("Notification", "metadata", obj.Metadata, "nested object validation failed", err)
    63  		}
    64  	}
    65  	if subobj, ok := interface{}(obj.State).(gotenvalidate.Validator); ok {
    66  		if err := subobj.GotenValidate(); err != nil {
    67  			return gotenvalidate.NewValidationError("Notification", "state", obj.State, "nested object validation failed", err)
    68  		}
    69  	}
    70  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    71  		return cvobj.GotenCustomValidate()
    72  	}
    73  	return nil
    74  }
    75  func (obj *Notification_State) GotenValidate() error {
    76  	if obj == nil {
    77  		return nil
    78  	}
    79  	for idx, elem := range obj.NotificationState {
    80  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    81  			if err := subobj.GotenValidate(); err != nil {
    82  				return gotenvalidate.NewValidationError("State", "notificationState", obj.NotificationState[idx], "nested object validation failed", err)
    83  			}
    84  		}
    85  	}
    86  	if subobj, ok := interface{}(obj.AlertsLifetime).(gotenvalidate.Validator); ok {
    87  		if err := subobj.GotenValidate(); err != nil {
    88  			return gotenvalidate.NewValidationError("State", "alertsLifetime", obj.AlertsLifetime, "nested object validation failed", err)
    89  		}
    90  	}
    91  	for idx, elem := range obj.ResolutionNotificationState {
    92  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    93  			if err := subobj.GotenValidate(); err != nil {
    94  				return gotenvalidate.NewValidationError("State", "resolutionNotificationState", obj.ResolutionNotificationState[idx], "nested object validation failed", err)
    95  			}
    96  		}
    97  	}
    98  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    99  		return cvobj.GotenCustomValidate()
   100  	}
   101  	return nil
   102  }
   103  func (obj *Notification_State_NotificationState) GotenValidate() error {
   104  	if obj == nil {
   105  		return nil
   106  	}
   107  	if subobj, ok := interface{}(obj.ProviderData).(gotenvalidate.Validator); ok {
   108  		if err := subobj.GotenValidate(); err != nil {
   109  			return gotenvalidate.NewValidationError("NotificationState", "providerData", obj.ProviderData, "nested object validation failed", err)
   110  		}
   111  	}
   112  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   113  		return cvobj.GotenCustomValidate()
   114  	}
   115  	return nil
   116  }
   117  func (obj *Notification_State_NotificationState_ProviderData) GotenValidate() error {
   118  	if obj == nil {
   119  		return nil
   120  	}
   121  	if subobj, ok := interface{}(obj.Slack).(gotenvalidate.Validator); ok {
   122  		if err := subobj.GotenValidate(); err != nil {
   123  			return gotenvalidate.NewValidationError("ProviderData", "slack", obj.Slack, "nested object validation failed", err)
   124  		}
   125  	}
   126  	if subobj, ok := interface{}(obj.PagerDuty).(gotenvalidate.Validator); ok {
   127  		if err := subobj.GotenValidate(); err != nil {
   128  			return gotenvalidate.NewValidationError("ProviderData", "pagerDuty", obj.PagerDuty, "nested object validation failed", err)
   129  		}
   130  	}
   131  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   132  		return cvobj.GotenCustomValidate()
   133  	}
   134  	return nil
   135  }
   136  func (obj *Notification_State_NotificationState_ProviderData_Slack) GotenValidate() error {
   137  	if obj == nil {
   138  		return nil
   139  	}
   140  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   141  		return cvobj.GotenCustomValidate()
   142  	}
   143  	return nil
   144  }
   145  func (obj *Notification_State_NotificationState_ProviderData_PagerDuty) GotenValidate() error {
   146  	if obj == nil {
   147  		return nil
   148  	}
   149  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   150  		return cvobj.GotenCustomValidate()
   151  	}
   152  	return nil
   153  }