// check runs all checks and user-defined validators on the builder.
check runs all checks and user-defined validators on the builder.
// check runs all checks and user - defined validators on the builder .
func (gc *GrantCreate) check() error {
	if _, ok := gc.mutation.CreatedAt(); !ok {
		return &ValidationError{Name: "created_at", err: errors.New("ent: missing required field \"created_at\"")}
	}
	if _, ok := gc.mutation.UpdatedAt(); !ok {
		return &ValidationError{Name: "updated_at", err: errors.New("ent: missing required field \"updated_at\"")}
	}
	if _, ok := gc.mutation.HashedGrantToken(); !ok {
		return &ValidationError{Name: "hashed_grant_token", err: errors.New("ent: missing required field \"hashed_grant_token\"")}
	}
	if _, ok := gc.mutation.Domain(); !ok {
		return &ValidationError{Name: "domain", err: errors.New("ent: missing required field \"domain\"")}
	}
	if _, ok := gc.mutation.Version(); !ok {
		return &ValidationError{Name: "version", err: errors.New("ent: missing required field \"version\"")}
	}
	if _, ok := gc.mutation.AllowedHTTPMethods(); !ok {
		return &ValidationError{Name: "allowed_http_methods", err: errors.New("ent: missing required field \"allowed_http_methods\"")}
	}
	if _, ok := gc.mutation.Paths(); !ok {
		return &ValidationError{Name: "paths", err: errors.New("ent: missing required field \"paths\"")}
	}
	if v, ok := gc.mutation.ID(); ok {
		if err := grant.IDValidator(v); err != nil {
			return &ValidationError{Name: "id", err: fmt.Errorf("ent: validator failed for field \"id\": %w", err)}
		}
	}
	return nil
}
func ( gc * GrantCreate ) check ( ) error { if _ , ok := gc . mutation . CreatedAt ( ) ; ! ok { return & ValidationError { Name : " " , err : errors . New ( " \" \" " ) } } if _ , ok := gc . mutation . UpdatedAt ( ) ; ! ok { return & ValidationError { Name : " " , err : errors . New ( " \" \" " ) } } if _ , ok := gc . mutation . HashedGrantToken ( ) ; ! ok { return & ValidationError { Name : " " , err : errors . New ( " \" \" " ) } } if _ , ok := gc . mutation . Domain ( ) ; ! ok { return & ValidationError { Name : " " , err : errors . New ( " \" \" " ) } } if _ , ok := gc . mutation . Version ( ) ; ! ok { return & ValidationError { Name : " " , err : errors . New ( " \" \" " ) } } if _ , ok := gc . mutation . AllowedHTTPMethods ( ) ; ! ok { return & ValidationError { Name : " " , err : errors . New ( " \" \" " ) } } if _ , ok := gc . mutation . Paths ( ) ; ! ok { return & ValidationError { Name : " " , err : errors . New ( " \" \" " ) } } if v , ok := gc . mutation . ID ( ) ; ok { if err := grant . IDValidator ( v ) ; err != nil { return & ValidationError { Name : " " , err : fmt . Errorf ( " \" \" " , err ) } } } return nil }
check runs all checks and user-defined validators on the builder.
check runs all checks and user - defined validators on the builder .