-
Notifications
You must be signed in to change notification settings - Fork 1
/
commits.go
50 lines (41 loc) · 1.07 KB
/
commits.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
41
42
43
44
45
46
47
48
49
50
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/FlatFilers/flatfile-go/core"
)
type CommitResponse struct {
Data *Commit `json:"data,omitempty" url:"data,omitempty"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (c *CommitResponse) GetExtraProperties() map[string]interface{} {
return c.extraProperties
}
func (c *CommitResponse) UnmarshalJSON(data []byte) error {
type unmarshaler CommitResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*c = CommitResponse(value)
extraProperties, err := core.ExtractExtraProperties(data, *c)
if err != nil {
return err
}
c.extraProperties = extraProperties
c._rawJSON = json.RawMessage(data)
return nil
}
func (c *CommitResponse) String() string {
if len(c._rawJSON) > 0 {
if value, err := core.StringifyJSON(c._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(c); err == nil {
return value
}
return fmt.Sprintf("%#v", c)
}