forked from koltyakov/gosip
/
file_gen.go
40 lines (32 loc) · 940 Bytes
/
file_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Code generated by `ggen -ent File -conf -mods Select,Expand -helpers Data,Normalized`; DO NOT EDIT.
package api
import (
"encoding/json"
)
// Conf receives custom request config definition, e.g. custom headers, custom OData mod
func (file *File) Conf(config *RequestConfig) *File {
file.config = config
return file
}
// Select adds $select OData modifier
func (file *File) Select(oDataSelect string) *File {
file.modifiers.AddSelect(oDataSelect)
return file
}
// Expand adds $expand OData modifier
func (file *File) Expand(oDataExpand string) *File {
file.modifiers.AddExpand(oDataExpand)
return file
}
/* Response helpers */
// Data response helper
func (fileResp *FileResp) Data() *FileInfo {
data := NormalizeODataItem(*fileResp)
res := &FileInfo{}
json.Unmarshal(data, &res)
return res
}
// Normalized returns normalized body
func (fileResp *FileResp) Normalized() []byte {
return NormalizeODataItem(*fileResp)
}