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

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/limits/proto/v1/accepted_plan.proto
     3  // DO NOT EDIT!!!
     4  
     5  package accepted_plan
     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  	common "github.com/cloudwan/edgelq-sdk/limits/resources/v1/common"
    26  	plan "github.com/cloudwan/edgelq-sdk/limits/resources/v1/plan"
    27  	meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service"
    28  	meta "github.com/cloudwan/goten-sdk/types/meta"
    29  )
    30  
    31  var (
    32  	_ = bytes.Equal
    33  	_ = errors.New
    34  	_ = fmt.Errorf
    35  	_ = net.ParseIP
    36  	_ = regexp.Match
    37  	_ = strings.Split
    38  	_ = time.Now
    39  	_ = utf8.RuneCountInString
    40  	_ = url.Parse
    41  	_ = gotenvalidate.NewValidationError
    42  )
    43  
    44  // make sure we're using proto imports
    45  var (
    46  	_ = &iam_organization.Organization{}
    47  	_ = &iam_project.Project{}
    48  	_ = &common.RegionalPlanAssignment{}
    49  	_ = &plan.Plan{}
    50  	_ = &meta_service.Service{}
    51  	_ = &meta.Meta{}
    52  )
    53  
    54  func (obj *AcceptedPlan) GotenValidate() error {
    55  	if obj == nil {
    56  		return nil
    57  	}
    58  	if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok {
    59  		if err := subobj.GotenValidate(); err != nil {
    60  			return gotenvalidate.NewValidationError("AcceptedPlan", "metadata", obj.Metadata, "nested object validation failed", err)
    61  		}
    62  	}
    63  	for idx, elem := range obj.RegionalPlanOverrides {
    64  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    65  			if err := subobj.GotenValidate(); err != nil {
    66  				return gotenvalidate.NewValidationError("AcceptedPlan", "regionalPlanOverrides", obj.RegionalPlanOverrides[idx], "nested object validation failed", err)
    67  			}
    68  		}
    69  	}
    70  	for idx, elem := range obj.Extensions {
    71  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    72  			if err := subobj.GotenValidate(); err != nil {
    73  				return gotenvalidate.NewValidationError("AcceptedPlan", "extensions", obj.Extensions[idx], "nested object validation failed", err)
    74  			}
    75  		}
    76  	}
    77  	for idx, elem := range obj.Allowances {
    78  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    79  			if err := subobj.GotenValidate(); err != nil {
    80  				return gotenvalidate.NewValidationError("AcceptedPlan", "allowances", obj.Allowances[idx], "nested object validation failed", err)
    81  			}
    82  		}
    83  	}
    84  	if subobj, ok := interface{}(obj.Assignee).(gotenvalidate.Validator); ok {
    85  		if err := subobj.GotenValidate(); err != nil {
    86  			return gotenvalidate.NewValidationError("AcceptedPlan", "assignee", obj.Assignee, "nested object validation failed", err)
    87  		}
    88  	}
    89  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    90  		return cvobj.GotenCustomValidate()
    91  	}
    92  	return nil
    93  }
    94  func (obj *AcceptedPlan_Assignee) GotenValidate() error {
    95  	if obj == nil {
    96  		return nil
    97  	}
    98  	switch opt := obj.Assignee.(type) {
    99  	case *AcceptedPlan_Assignee_ProjectAssignee:
   100  	case *AcceptedPlan_Assignee_OrganizationAssignee:
   101  	case *AcceptedPlan_Assignee_ServiceAssignee:
   102  	default:
   103  		_ = opt
   104  	}
   105  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   106  		return cvobj.GotenCustomValidate()
   107  	}
   108  	return nil
   109  }