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

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/limits/proto/v1/plan_assignment_request.proto
     3  // DO NOT EDIT!!!
     4  
     5  package plan_assignment_request
     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  	accepted_plan "github.com/cloudwan/edgelq-sdk/limits/resources/v1/accepted_plan"
    26  	common "github.com/cloudwan/edgelq-sdk/limits/resources/v1/common"
    27  	plan "github.com/cloudwan/edgelq-sdk/limits/resources/v1/plan"
    28  	plan_assignment "github.com/cloudwan/edgelq-sdk/limits/resources/v1/plan_assignment"
    29  	meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service"
    30  	meta "github.com/cloudwan/goten-sdk/types/meta"
    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  	_ = &iam_organization.Organization{}
    49  	_ = &iam_project.Project{}
    50  	_ = &accepted_plan.AcceptedPlan{}
    51  	_ = &common.RegionalPlanAssignment{}
    52  	_ = &plan.Plan{}
    53  	_ = &plan_assignment.PlanAssignment{}
    54  	_ = &meta_service.Service{}
    55  	_ = &meta.Meta{}
    56  )
    57  
    58  func (obj *PlanAssignmentRequest) GotenValidate() error {
    59  	if obj == nil {
    60  		return nil
    61  	}
    62  	if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok {
    63  		if err := subobj.GotenValidate(); err != nil {
    64  			return gotenvalidate.NewValidationError("PlanAssignmentRequest", "metadata", obj.Metadata, "nested object validation failed", err)
    65  		}
    66  	}
    67  	if subobj, ok := interface{}(obj.Request).(gotenvalidate.Validator); ok {
    68  		if err := subobj.GotenValidate(); err != nil {
    69  			return gotenvalidate.NewValidationError("PlanAssignmentRequest", "request", obj.Request, "nested object validation failed", err)
    70  		}
    71  	}
    72  	if subobj, ok := interface{}(obj.Status).(gotenvalidate.Validator); ok {
    73  		if err := subobj.GotenValidate(); err != nil {
    74  			return gotenvalidate.NewValidationError("PlanAssignmentRequest", "status", obj.Status, "nested object validation failed", err)
    75  		}
    76  	}
    77  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    78  		return cvobj.GotenCustomValidate()
    79  	}
    80  	return nil
    81  }
    82  func (obj *PlanAssignmentRequest_Status) GotenValidate() error {
    83  	if obj == nil {
    84  		return nil
    85  	}
    86  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    87  		return cvobj.GotenCustomValidate()
    88  	}
    89  	return nil
    90  }
    91  func (obj *PlanAssignmentRequest_RequestType) GotenValidate() error {
    92  	if obj == nil {
    93  		return nil
    94  	}
    95  	switch opt := obj.Request.(type) {
    96  	case *PlanAssignmentRequest_RequestType_Assign_:
    97  		if subobj, ok := interface{}(opt.Assign).(gotenvalidate.Validator); ok {
    98  			if err := subobj.GotenValidate(); err != nil {
    99  				return gotenvalidate.NewValidationError("RequestType", "assign", opt.Assign, "nested object validation failed", err)
   100  			}
   101  		}
   102  	case *PlanAssignmentRequest_RequestType_Extend_:
   103  		if subobj, ok := interface{}(opt.Extend).(gotenvalidate.Validator); ok {
   104  			if err := subobj.GotenValidate(); err != nil {
   105  				return gotenvalidate.NewValidationError("RequestType", "extend", opt.Extend, "nested object validation failed", err)
   106  			}
   107  		}
   108  	case *PlanAssignmentRequest_RequestType_Unassign_:
   109  		if subobj, ok := interface{}(opt.Unassign).(gotenvalidate.Validator); ok {
   110  			if err := subobj.GotenValidate(); err != nil {
   111  				return gotenvalidate.NewValidationError("RequestType", "unassign", opt.Unassign, "nested object validation failed", err)
   112  			}
   113  		}
   114  	default:
   115  		_ = opt
   116  	}
   117  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   118  		return cvobj.GotenCustomValidate()
   119  	}
   120  	return nil
   121  }
   122  func (obj *PlanAssignmentRequest_RequestType_Assign) GotenValidate() error {
   123  	if obj == nil {
   124  		return nil
   125  	}
   126  	for idx, elem := range obj.Extensions {
   127  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   128  			if err := subobj.GotenValidate(); err != nil {
   129  				return gotenvalidate.NewValidationError("Assign", "extensions", obj.Extensions[idx], "nested object validation failed", err)
   130  			}
   131  		}
   132  	}
   133  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   134  		return cvobj.GotenCustomValidate()
   135  	}
   136  	return nil
   137  }
   138  func (obj *PlanAssignmentRequest_RequestType_Extend) GotenValidate() error {
   139  	if obj == nil {
   140  		return nil
   141  	}
   142  	for idx, elem := range obj.Additions {
   143  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   144  			if err := subobj.GotenValidate(); err != nil {
   145  				return gotenvalidate.NewValidationError("Extend", "additions", obj.Additions[idx], "nested object validation failed", err)
   146  			}
   147  		}
   148  	}
   149  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   150  		return cvobj.GotenCustomValidate()
   151  	}
   152  	return nil
   153  }
   154  func (obj *PlanAssignmentRequest_RequestType_Unassign) GotenValidate() error {
   155  	if obj == nil {
   156  		return nil
   157  	}
   158  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   159  		return cvobj.GotenCustomValidate()
   160  	}
   161  	return nil
   162  }