2020-06-22 21:21:02 +02:00
|
|
|
package form
|
|
|
|
|
2021-11-26 14:28:50 +01:00
|
|
|
// SearchFolders represents search form fields for "/api/v1/folders".
|
|
|
|
type SearchFolders struct {
|
2020-06-22 21:21:02 +02:00
|
|
|
Query string `form:"q"`
|
|
|
|
Recursive bool `form:"recursive"`
|
|
|
|
Files bool `form:"files"`
|
|
|
|
Uncached bool `form:"uncached"`
|
|
|
|
Count int `form:"count" serialize:"-"`
|
|
|
|
Offset int `form:"offset" serialize:"-"`
|
|
|
|
}
|
|
|
|
|
2021-11-26 14:28:50 +01:00
|
|
|
func (f *SearchFolders) GetQuery() string {
|
2020-06-22 21:21:02 +02:00
|
|
|
return f.Query
|
|
|
|
}
|
|
|
|
|
2021-11-26 14:28:50 +01:00
|
|
|
func (f *SearchFolders) SetQuery(q string) {
|
2020-06-22 21:21:02 +02:00
|
|
|
f.Query = q
|
|
|
|
}
|
|
|
|
|
2021-11-26 14:28:50 +01:00
|
|
|
func (f *SearchFolders) ParseQueryString() error {
|
2020-06-22 21:21:02 +02:00
|
|
|
return ParseQueryString(f)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Serialize returns a string containing non-empty fields and values of a struct.
|
2021-11-26 14:28:50 +01:00
|
|
|
func (f *SearchFolders) Serialize() string {
|
2020-06-22 21:21:02 +02:00
|
|
|
return Serialize(f, false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// SerializeAll returns a string containing all non-empty fields and values of a struct.
|
2021-11-26 14:28:50 +01:00
|
|
|
func (f *SearchFolders) SerializeAll() string {
|
2020-06-22 21:21:02 +02:00
|
|
|
return Serialize(f, true)
|
|
|
|
}
|