// Code generated by Validator v0.1.4. DO NOT EDIT.

package demonote

import (
	"bytes"
	"fmt"
	"reflect"
	"regexp"
	"strings"
	"time"
)

// unused protection
var (
	_ = fmt.Formatter(nil)
	_ = (*bytes.Buffer)(nil)
	_ = (*strings.Builder)(nil)
	_ = reflect.Type(nil)
	_ = (*regexp.Regexp)(nil)
	_ = time.Nanosecond
)

func (p *BaseResp) IsValid() error {
	return nil
}
func (p *Note) IsValid() error {
	return nil
}
func (p *CreateNoteRequest) IsValid() error {
	if len(p.Title) < int(1) {
		return fmt.Errorf("field Title min_len rule failed, current value: %d", len(p.Title))
	}
	if len(p.Content) < int(1) {
		return fmt.Errorf("field Content min_len rule failed, current value: %d", len(p.Content))
	}
	if p.UserId <= int64(0) {
		return fmt.Errorf("field UserId gt rule failed, current value: %v", p.UserId)
	}
	return nil
}
func (p *CreateNoteResponse) IsValid() error {
	if p.BaseResp != nil {
		if err := p.BaseResp.IsValid(); err != nil {
			return fmt.Errorf("filed BaseResp not valid, %w", err)
		}
	}
	return nil
}
func (p *DeleteNoteRequest) IsValid() error {
	if p.NoteId <= int64(0) {
		return fmt.Errorf("field NoteId gt rule failed, current value: %v", p.NoteId)
	}
	return nil
}
func (p *DeleteNoteResponse) IsValid() error {
	if p.BaseResp != nil {
		if err := p.BaseResp.IsValid(); err != nil {
			return fmt.Errorf("filed BaseResp not valid, %w", err)
		}
	}
	return nil
}
func (p *UpdateNoteRequest) IsValid() error {
	if p.NoteId <= int64(0) {
		return fmt.Errorf("field NoteId gt rule failed, current value: %v", p.NoteId)
	}
	return nil
}
func (p *UpdateNoteResponse) IsValid() error {
	if p.BaseResp != nil {
		if err := p.BaseResp.IsValid(); err != nil {
			return fmt.Errorf("filed BaseResp not valid, %w", err)
		}
	}
	return nil
}
func (p *QueryNoteRequest) IsValid() error {
	if p.UserId <= int64(0) {
		return fmt.Errorf("field UserId gt rule failed, current value: %v", p.UserId)
	}
	if p.Offset < int64(0) {
		return fmt.Errorf("field Offset ge rule failed, current value: %v", p.Offset)
	}
	if p.Limit < int64(0) {
		return fmt.Errorf("field Limit ge rule failed, current value: %v", p.Limit)
	}
	return nil
}
func (p *QueryNoteResponse) IsValid() error {
	if p.BaseResp != nil {
		if err := p.BaseResp.IsValid(); err != nil {
			return fmt.Errorf("filed BaseResp not valid, %w", err)
		}
	}
	return nil
}
func (p *MGetNoteRequest) IsValid() error {
	if len(p.NoteIds) < int(1) {
		return fmt.Errorf("field NoteIds MinLen rule failed, current value: %v", p.NoteIds)
	}
	return nil
}
func (p *MGetNoteResponse) IsValid() error {
	if p.BaseResp != nil {
		if err := p.BaseResp.IsValid(); err != nil {
			return fmt.Errorf("filed BaseResp not valid, %w", err)
		}
	}
	return nil
}
