github.com/cloudwan/edgelq-sdk@v1.15.4/limits/resources/v1/plan_assignment/plan_assignment_change.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/limits/proto/v1/plan_assignment_change.proto
     3  // DO NOT EDIT!!!
     4  
     5  package plan_assignment
     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  	meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service"
    26  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    27  )
    28  
    29  var (
    30  	_ = bytes.Equal
    31  	_ = errors.New
    32  	_ = fmt.Errorf
    33  	_ = net.ParseIP
    34  	_ = regexp.Match
    35  	_ = strings.Split
    36  	_ = time.Now
    37  	_ = utf8.RuneCountInString
    38  	_ = url.Parse
    39  	_ = gotenvalidate.NewValidationError
    40  )
    41  
    42  // make sure we're using proto imports
    43  var (
    44  	_ = &iam_organization.Organization{}
    45  	_ = &iam_project.Project{}
    46  	_ = &fieldmaskpb.FieldMask{}
    47  	_ = &meta_service.Service{}
    48  )
    49  
    50  func (obj *PlanAssignmentChange) GotenValidate() error {
    51  	if obj == nil {
    52  		return nil
    53  	}
    54  	switch opt := obj.ChangeType.(type) {
    55  	case *PlanAssignmentChange_Added_:
    56  		if subobj, ok := interface{}(opt.Added).(gotenvalidate.Validator); ok {
    57  			if err := subobj.GotenValidate(); err != nil {
    58  				return gotenvalidate.NewValidationError("PlanAssignmentChange", "added", opt.Added, "nested object validation failed", err)
    59  			}
    60  		}
    61  	case *PlanAssignmentChange_Modified_:
    62  		if subobj, ok := interface{}(opt.Modified).(gotenvalidate.Validator); ok {
    63  			if err := subobj.GotenValidate(); err != nil {
    64  				return gotenvalidate.NewValidationError("PlanAssignmentChange", "modified", opt.Modified, "nested object validation failed", err)
    65  			}
    66  		}
    67  	case *PlanAssignmentChange_Current_:
    68  		if subobj, ok := interface{}(opt.Current).(gotenvalidate.Validator); ok {
    69  			if err := subobj.GotenValidate(); err != nil {
    70  				return gotenvalidate.NewValidationError("PlanAssignmentChange", "current", opt.Current, "nested object validation failed", err)
    71  			}
    72  		}
    73  	case *PlanAssignmentChange_Removed_:
    74  		if subobj, ok := interface{}(opt.Removed).(gotenvalidate.Validator); ok {
    75  			if err := subobj.GotenValidate(); err != nil {
    76  				return gotenvalidate.NewValidationError("PlanAssignmentChange", "removed", opt.Removed, "nested object validation failed", err)
    77  			}
    78  		}
    79  	default:
    80  		_ = opt
    81  	}
    82  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    83  		return cvobj.GotenCustomValidate()
    84  	}
    85  	return nil
    86  }
    87  func (obj *PlanAssignmentChange_Added) GotenValidate() error {
    88  	if obj == nil {
    89  		return nil
    90  	}
    91  	if subobj, ok := interface{}(obj.PlanAssignment).(gotenvalidate.Validator); ok {
    92  		if err := subobj.GotenValidate(); err != nil {
    93  			return gotenvalidate.NewValidationError("Added", "planAssignment", obj.PlanAssignment, "nested object validation failed", err)
    94  		}
    95  	}
    96  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    97  		return cvobj.GotenCustomValidate()
    98  	}
    99  	return nil
   100  }
   101  func (obj *PlanAssignmentChange_Modified) GotenValidate() error {
   102  	if obj == nil {
   103  		return nil
   104  	}
   105  	if subobj, ok := interface{}(obj.PlanAssignment).(gotenvalidate.Validator); ok {
   106  		if err := subobj.GotenValidate(); err != nil {
   107  			return gotenvalidate.NewValidationError("Modified", "planAssignment", obj.PlanAssignment, "nested object validation failed", err)
   108  		}
   109  	}
   110  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   111  		return cvobj.GotenCustomValidate()
   112  	}
   113  	return nil
   114  }
   115  func (obj *PlanAssignmentChange_Current) GotenValidate() error {
   116  	if obj == nil {
   117  		return nil
   118  	}
   119  	if subobj, ok := interface{}(obj.PlanAssignment).(gotenvalidate.Validator); ok {
   120  		if err := subobj.GotenValidate(); err != nil {
   121  			return gotenvalidate.NewValidationError("Current", "planAssignment", obj.PlanAssignment, "nested object validation failed", err)
   122  		}
   123  	}
   124  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   125  		return cvobj.GotenCustomValidate()
   126  	}
   127  	return nil
   128  }
   129  func (obj *PlanAssignmentChange_Removed) GotenValidate() error {
   130  	if obj == nil {
   131  		return nil
   132  	}
   133  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   134  		return cvobj.GotenCustomValidate()
   135  	}
   136  	return nil
   137  }