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

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/devices/proto/v1/tpm_attestation_cert.proto
     3  // DO NOT EDIT!!!
     4  
     5  package tpm_attestation_cert
     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  	project "github.com/cloudwan/edgelq-sdk/devices/resources/v1/project"
    24  	meta "github.com/cloudwan/goten-sdk/types/meta"
    25  )
    26  
    27  var (
    28  	_ = bytes.Equal
    29  	_ = errors.New
    30  	_ = fmt.Errorf
    31  	_ = net.ParseIP
    32  	_ = regexp.Match
    33  	_ = strings.Split
    34  	_ = time.Now
    35  	_ = utf8.RuneCountInString
    36  	_ = url.Parse
    37  	_ = gotenvalidate.NewValidationError
    38  )
    39  
    40  // make sure we're using proto imports
    41  var (
    42  	_ = &project.Project{}
    43  	_ = &meta.Meta{}
    44  )
    45  
    46  func (obj *TpmAttestationCert) GotenValidate() error {
    47  	if obj == nil {
    48  		return nil
    49  	}
    50  	if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok {
    51  		if err := subobj.GotenValidate(); err != nil {
    52  			return gotenvalidate.NewValidationError("TpmAttestationCert", "metadata", obj.Metadata, "nested object validation failed", err)
    53  		}
    54  	}
    55  	{
    56  		rlen := utf8.RuneCountInString(obj.DisplayName)
    57  		if rlen > 256 {
    58  			return gotenvalidate.NewValidationError("TpmAttestationCert", "displayName", obj.DisplayName, "field must contain at most 256 characters", nil)
    59  		}
    60  	}
    61  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    62  		return cvobj.GotenCustomValidate()
    63  	}
    64  	return nil
    65  }